0

C# を使用して、サーバー側で JQGrid を介して生成されるテーブルの CSS に取り組んでいます。クライアント側でレイアウト定義(幅など)をオーバーライドしようとしました(もちろん、サーバー側のテーブルがコードで生成された後)が、何も得られませんでした。機能した唯一のことは、まったく新しい jqgrid オブジェクトを作成することです。これは明らかにすべてのサーバー側の定義を無効にするため、役に立ちません。

クライアント側でオブジェクトの JavaScript コピーを何らかの方法で再生成し、変更を適用する方法はありますか?

どうぞよろしくお願いいたします。

編集:C#でテーブルを生成するために使用されるコードは次のとおりです。

        this.projectGrid = new JQGrid
        {
            Columns = new List<JQGridColumn>()
            {
                new JQGridColumn { Visible=true,
                                   Editable=false,
                                 //  Width=70,
                                   DataField="compliance_colour",
                                   HeaderText="Comp.",
                                   Searchable=false,
                                    Formatter = new CustomFormatter
                                                             {
                                                              FormatFunction = "formatCmpImage"

                                                             }


                },
                new JQGridColumn{ DataField="ProjectID",
                                  PrimaryKey=true,
                                  Visible=true,
                                  Editable=false,
                                  HeaderText="ID",
                                //  Width=50,
                                  Searchable=false
                },
                new JQGridColumn{ DataField="OpsRegion",
                                  Visible=true,
                                  Editable=false,
                                  HeaderText="Ops Region",
                               //   Width=180,
                                  Searchable=false

                },
                  new JQGridColumn{DataField="customer",
                                 Visible=true,
                                 Editable=false,
                                 HeaderText="Customer Name",
                               //  Width=180,
                                 Searchable=false

                },
                  new JQGridColumn{ DataField="projectName",
                                  Visible=true,
                                  Editable=false,
                                  HeaderText="Project Name",
                                //  Width=300,
                                  Searchable=false,
                                  Formatter = new CustomFormatter
                                                             {
                                                              FormatFunction = "formatLink",

                                                             }


                },

                new JQGridColumn{DataField="projectManager",
                                 Visible=true,
                                 Editable=false,
                                 HeaderText="Project Manager",
                              //   Width=110,
                                    Searchable=false
                },
                new JQGridColumn{DataField="status",
                                 Visible=true,
                                 Editable=false,
                                 HeaderText="Status",
                              //   Width=70,
                                 Searchable=false

                },
                new JQGridColumn {DataField="type",
                                  Visible=true,
                                  Editable=false,
                                  HeaderText="Type",
                             //     Width=70,
                                  Searchable=false

                },
                new JQGridColumn {DataField="favorite",
                                  Visible=true,
                                  Editable=false,
                                  HeaderText="Favorite",
                              //    Width=60,
                                  Searchable=false,
                                  Formatter = new CustomFormatter
                                                                {
                                                                    FormatFunction = "formatFvImage",
                                                                    UnFormatFunction = "unformatCell"
                                                                }

                },
                 new JQGridColumn {DataField="compliance_reason",
                                  Visible=false      
                },
                 new JQGridColumn {DataField="lastUpdate",
                                  Visible=true,
                                  Editable=false,
                               //   Width=60,
                                  HeaderText="Last Update",
                                  Searchable=false,
                                  Formatter = new CustomFormatter
                                                                {
                                                                    FormatFunction = "formatReportLink",
                                                                    UnFormatFunction = "unformatCell"
                                                                }

                },
            },
           Width = Unit.Pixel(1400),
            ShrinkToFit=true,
            Height = Unit.Pixel(520),

        };
4

1 に答える 1

0

widthグリッドを変更する必要がある場合は、 setGridWidthメソッドを使用できます。他の多くの jqGrid オプションを上書きするには、setGridParam代わりに使用できます。グリッドの作成にメソッドを使用できます。一般に、正確なオプション ( 、、など) が存在する場合は、jqGridメソッドを使用する必要があります。オプションを変更するための特別な jqGrid メソッドが見つからない場合は、おそらくメソッドを使用する必要があります。setCaptionsetGridHeightsetColPropsetGridParam

于 2012-06-25T09:49:12.667 に答える