以下代码在IE9,IE10,Firefox和Chrome中运行良好,但在IE8中没有(我在IE8模式下使用IE10进行测试)。网格根本没有出现,好像什么也没有。
$(document).ready(function () {
$("#grid").jqGrid({
url: "/Forms/GetData",
datatype: 'json',
mtype: 'GET',
height: 'auto',
width: 950,
colNames: ['Id', 'Date', 'LEM Number', 'Job Number', 'Job Phase', 'Foreman', 'Approved', 'Signed', 'Billed'],
colModel: [
{ name: 'id', index: 'id', width: 55, hidden: true },
{ name: 'date', index: 'date', width: 80, sorttype: 'date', formatter: 'date', formatoptions: { newformat: 'm/d/Y' }, search: true, searchoptions: { dataInit: function(el) { $(el).daterangepicker({ dateFormat: 'yy/mm/dd' }); } } },
{ name: 'lemnumber', index: 'lemnumber', width: 80, align: 'right', sorttype: 'int' },
{ name: 'jobnumber', index: 'jobnumber', width: 80, align: 'right', sorttype: 'int' },
{ name: 'jobphase', index: 'jobphase', width: 80 },
{ name: 'foreman', index: 'foreman', width: 80 },
{ name: 'approved', index: 'approved', width: 80, align: 'center', formatter: 'checkbox' },
{ name: 'signed', index: 'signed', width: 80, align: 'center', formatter: 'checkbox' },
{ name: 'billed', index: 'billed', width: 80, align: 'center', formatter: 'checkbox' }
],
pager: '#pager',
rowNum: 20,
rowList: [10, 20, 30],
sortname: 'id',
loadonce: true,
multiselect: true,
viewrecords: true,
});
//$("#grid").jqGrid('filterToolbar', { searchOperators: true, stringResult: true, searchOnEnter: false, defaultSearch: "cn" });
$("#grid").navGrid('#pager', { edit: false, add: false, del: false }, {}, {}, {}, { multipleSelect: true });
$("#startdate").datepicker();
$("#enddate").datepicker();
});
和HTML
<div class="row">
<table id="grid">
</table>
<div id="pager" class="scroll">
</div>
</div>
为什么不出现?