0
我有一個簡單的網格,帶有導航器(工具欄),如下所示; Firefox,Chrome能夠顯示工具欄,但是,我的IE不是。jqGrid - 工具欄/導航器不顯示在IE 9上?
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8.16.custom.css"/>
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/grid.locale-en.js" ></script>
<script type="text/javascript" src="js/jquery.jqGrid.min.js" ></script>
</head>
<body>
<table id="grid1">
<div id="pager1"></div>
</table>
<script type="text/javascript">
jQuery("#grid1").jqGrid({
datatype: "local",
height: 250,
pager: '#pager1',
colNames:['Inv No', 'Client','Notes','Checked?' ],
colModel:[
{name:'id',index:'id', width:60, sortable:false},
{name:'name',index:'name', width:100, sortable:false},
{name:'note',index:'note', width:150, sortable:false},
{name:'ind_checked',index:'ind_checked', width:100, sortable:false, align:'center', editable:true,
edittype:'checkbox', editoptions: { value:"Yes:No" }, formatter:'checkbox'}
],
caption: "Testing" }
).navGrid('#pager1');
var mydata = [
{id:"1",name:"test1",note:"note1",ind_checked:"yes"},
{id:"2",name:"test2",note:"note2",ind_checked:"No"},
{id:"3",name:"test3",note:"note3",ind_checked:"No"},
{id:"4",name:"test4",note:"note4",ind_checked:"yes"},
{id:"5",name:"test5",note:"note5",ind_checked:"yes"},
{id:"6",name:"test6",note:"note6",ind_checked:"No"},
{id:"7",name:"test7",note:"note7",ind_checked:"No"},
{id:"8",name:"test8",note:"note8",ind_checked:"yes"},
{id:"9",name:"test9",note:"note9",ind_checked:"No"} ]
;
for(var i=0;i<mydata.length;i++) {
jQuery("#grid1").jqGrid('addRowData',i+1,mydata[i]);
}
</script>
</body>
</html>
我使用IE 9,jqGrid 4.3測試它們。
有誰能告訴我我錯過了什麼嗎? IE中的任何設置都會改變?請告訴我,謝謝。
你在for循環中有一個錯誤:將'<='改爲'<',但我不認爲這會導致IE9失敗。在IE8中,這個[示例](http://jsfiddle.net/AF2vS/)沒有問題;我無法使用IE9進行測試。 – scessor 2012-01-11 18:37:00
@scessor,是的,必須在for循環中修正爲<。但是,我仍然無法獲得IE9中出現的工具欄。我將嘗試在IE8上測試以查看結果。謝謝。 – early 2012-01-11 20:21:27
啊,對不起,工具欄也不會出現在IE8中。 – scessor 2012-01-11 20:43:25