我可以确定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 );