我建立了一个非常基本的jqgrid表。它显示了我提供的URL的结果,没有任何问题。如果我单击“添加行”或“编辑行”图标,则会出现一个空窗口,其中没有要填写的字段。
这是我的代码:
$('#mygrid').jqGrid({
colMenu: true,
url: 'someurl.php',
datatype:'json',
colNames:['NUMB','ACCNAME','MEMO','TOTAL','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC','JAN','FEB','MAR'],
colModel: [
{ name: "ACCOUNT_NUMBER", width:60},
{ name: "ACCNAME", editable: "true"},
{ name: "DETAIL", editable: "true", edittype:"textarea", editoptions:{size:10} },
{ name: "TOTAL", width:75, classes:'text-primary', editable: "true",editoptions:{size:10} },
{ name: "APR", index: "APR", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "MAY", index: "MAY", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "JUN", index: "JUN", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "JUL", index: "JUL", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "AUG", index: "AUG", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "SEP", index: "SEP", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "OCT", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "NOV", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "DEC", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "JAN", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "FEB", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} },
{ name: "MAR", width:75, editable: "true",edittype:"textarea",editoptions:{size:10} }
],
viewrecords: true,
emptyrecords: "Nothing to display",
rowNum: 15,
styleUI : 'Bootstrap4',
iconSet : 'Octicons',
pager : '#gridpager',
autowidth : true,
shrinkToFit : false,
height : '75%',
rowList : [10, 20, 30],
altRows : true,
toppager : true,
caption: "something",
editurl : 'anotherurl.php'
});
$("#mygrid").jqGrid('navGrid','#gridpager',{add:true,edit:true,del:true,search:true,refresh:true});
这是弹出的空窗口:
答案 0 :(得分:0)
您遇到的问题是设置editable属性。您将其设置为字符串,但应为布尔值。在colModel项目中替换
editable : "true"
使用
editable : true
这是Java语言的一大不同