我使用* jqGrid 5.1.0
我找到文檔。 http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_buttons 這是相當容易的文檔,但添加這樣的代碼後,我的jqGrid不添加按鈕。控制檯中沒有錯誤。此外,此按鈕的最後多餘的列不會出現。 我將是幫助jqGrid。無法創建刪除按鈕
$("#list").jqGrid({
url: "/backend.php",
datatype: "xml",
mtype: "POST",
colNames: ["Клиент", "id", "Адрес", "Дата", "Время", "Водитель","Оборудование", "Примечание"],
colModel: [
{ name: "name", width: 80, align: "center", editable: true, sorttype:'string', searchoptions:{sopt:['eq','bw','bn','cn','nc','ew','en']}},
{ name: "order_id", width: 80, align: "center", sorttype:'integer', searchoptions:{sopt:['eq','ne','le','lt','gt','ge']}},
{ name: "address", width: 160, align: "center", editable: true },
{ name: "date", width: 80, align: "center", editable: true },
{ name: "time", width: 80, align: "center", editable: true },
{ name: "driver", width: 80, align: "center", editable: false },
{ name: "equip", width: 100, align: "center", editable: true },
{ name: "notice", width: 80, align: "center", editable: true },
],
pager: "#pager",
rowNum: 10,
rowList: [10, 20, 30],
viewrecords: true,
onSelectRow: function(id){ if(id && id!==lastsel && lastsel!=0){ jQuery('#list').jqGrid('saveRow',lastsel); jQuery('#list').jqGrid('editRow',id,true); lastsel=id; }else{ if(lastsel==0){ jQuery('#list').jqGrid('editRow',id,true); lastsel=id; } } },
editurl: "/iwater/backend.php",
gridview: true,
autoencode: false,
caption: "Заказы",
loadonce: true,
sortable:true
});
$("#list").jqGrid('navGrid',"#pager",{edit:false,add:false,del:false}).navButtonAdd('#pager',{
caption:"Del",
buttonicon:"ui-icon-del",
onClickButton: function(){
alert("Deleting Row");
},
position:"last"
});
$("#list").jqGrid('filterToolbar',{searchOperators : true});
$("#list").jqGrid('setGridHeight',300);