开发者

jqGrid columns width seem to go off after clicking on paginator

开发者 https://www.devze.com 2023-01-10 22:47 出处:网络
Using jqGrid version 3.6.5 Current pager extended options: { add: false, del: fals开发者_开发百科e, edit: false, search: false,

Using jqGrid version 3.6.5

Current pager extended options:

{ add: false, del: fals开发者_开发百科e, edit: false, search: false, 
    refresh: false, position: "left" }

Current grid options:

$("#tblID").jqGrid({
                url: '...',
                datatype: datatype,
                datastr: GridJsonData,
                mtype: 'GET',
                colNames: arrColumnLabels,
                colModel: gridColumns,
                rowNum: 10,
                rowList: [10, 20, 30],
                pager: $('#pgrID'),
                sortname: '',
                viewrecords: true,
                sortorder: "desc",
                caption: "",
                forceFit: true,
                previewPaneMessageId: 0,
                previewPaneProjectId: 0,
                height: "100%",

Fixed width columns appear different from initial load after I navigate with the pager. Is there an options I need to add to ensure that widths in colModel persists?

I notice the setGridWidth is the method causing the problem. So I need a solution which uses setGridWidth but still allow the columns with fixed widths to remain fixed (according to colModel), while the dynamic width columns expand/reduce to fill the gap.


I had to upgrade to jqgrid 3.7.2 and utilise the "fixed" property.

[DataMember(Name = "fixed")]
        public bool Fixed { get; set; }

...

internal static JsonColumnData JsonColumnGridSelector
        {
            get { return new JsonColumnData { name = "GridSelector", index = "", width = 35, Fixed = true, align = "center"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号