English 中文(简体)
JqGrid Width resizing Issue with Browser resize
原标题:JqGrid Width resizing Issue with Browser resize
  • 时间:2012-01-12 11:45:50
  •  标签:
  • jqgrid

我可以确定JqGrid的宽度,从而自动地用浏览器切割。

曾经尝试过。

  autowidth:true,
  .....
  $(window).bind( resize , function () {
        $("#table").setGridWidth($("#table").width());
    }).trigger( resize );

Resizing isnt working as expected, When I resize the browser I expect grid to resize accordingly to that of browser width.

最新资料:

 $(function () {
        $grid = $("#table");
        $grid.jqGrid({
            url:  ../../Services/OrderService.asmx/getGlbOrders ,
            datatype:  json ,
            mtype:  POST ,
            ajaxGridOptions: { contentType:  application/json; charset=utf-8  },
            serializeGridData: function (postData) {

                if (postData.searchField === undefined) postData.searchField = null;
                if (postData.searchString === undefined) postData.searchString = null;
                if (postData.searchOper === undefined) postData.searchOper = null;
                //if (postData.filters === undefined) postData.filters = null;                   
                return JSON.stringify(postData);
            },

            jsonReader: {
                root: "d.rows",
                page: "d.page",
                total: "d.total",
                records: "d.records",
                id: "d.names"
            },
            colModel: [
                     { name:  select , label:  select , width: 50,
                         formatter: function radio(cellValue, option) {
                             return  <input type="radio" name="radio_  + option.gid +  "  value=  + cellValue +   /> ;
                         }
                     },
                     { name:  code , label:  Order ID  },
                     { name:  qty , label:  Quantity  },
                     { name:  qtyr , label:  Remaining Qty },
                     { name:  uts , label:  Units  },
                     { name:  status , label:  Status  },
                ],


            rowNum: 10,
            rowList: [10, 20, 300],
            sortname:  name ,
            sortorder: "asc",
            pager: "#pager",
            viewrecords: true,
            gridview: true,
            rownumbers: true,
            height: 250,
            autowidth: true,
            caption:  Global Order List 
        }).jqGrid( navGrid ,  #pager , { edit: false, add: false, del: false, search: false });

    })


     $(window).bind( resize , function () {
         $("#table").setGridWidth($("#table").width());
     }).trigger( resize );
问题回答

修改你的法典:

$(function () {
        $grid = $("#table");
        $grid.jqGrid({
            // etc..
        }).jqGrid( navGrid ,  #pager , { edit: false, add: false, del: false, search: false });

})

$(window).bind( resize , function () {
    $("#table").setGridWidth($("#table").width());
}).trigger( resize );

:

$(function () {
        $grid = $("#table");
        $grid.jqGrid({
            // etc..
        }).jqGrid( navGrid ,  #pager , { edit: false, add: false, del: false, search: false });

});

$(window).bind( resize , function () {
    $("#table").setGridWidth($("#table").width());
}).trigger( resize );

你在 j格里德职能结束之后,就忘记了一块半殖民地。 然后,你的职能之后出现的法典被忽略。





相关问题
Retrieving original row data from jqGrid

It is possible to use the getRowData method to retrieve the current of a cell but this retrieves the current cell content rather than the original data before it went through the formatter. How do I ...

How to programmatically select top row of JQGrid?

How does one programmatically select the top row of a JQGrid. I want to have the top row already selected when it is opened on the page. My grid is sorted by a descriptive column so the first row s id ...

Blank when NaN in jqGrid cells

How to set blank instead of NaN in jqGrid cells ? Using formatter ? Is there an example?

complete jqGrid?

Please, can anyone tell me how to use jqGrid? I want to do edit, add & delete functionality. Also I want to show an image in the grid Please tell me, what can I do, and how can I do?

jqGrid: is there an event for when columns are reordered?

I m using the column reordering feature in jqGrid $grid = jQuery("#list").jqGrid({ sortable:true, ... }); Is there an event that fires after columns are re-ordered? If there is, I can t see ...

Wrapping Text lines in JqGrid

Can you get lines of text to wrap in JqGrid? I have had a look round but i can t find anything.

using jqgrid style for usual Table in asp.net mvc

I d prefer using Table and td instead of JqGrid but i like JqGrid styles. has anyone used jqgrid style for usual Grid of asp.net MVC(i mean Table and td) before?

热门标签