免费jqgrid显示订单。 张贴的订单应该有黄色背景,只有打开行动button。 未发布的订单有白色背景,标准删除和自定义后操作button。 colmodel for actions列: {"hidden":false,"label":"Activity","name":"_actions","search":false,"width":94 ,"sortable":false,"formatter":"actions","viewable":false,"formatoptions":{"editbutton":false,"onSuccess":function (jqXHR) { jqXHRFromOnSuccess=jqXHR;return true;} ,"delbutton":true,"delOptions":{"url":"http://localhost:52216/admin/Grid/Delete?_entity=DoklstlT","afterComplete":function (response, postdata, formid) { summarefresh($grid); $grid[0].focus(); } }}}, 发布状态由布林Kinnitatud列确定: {"label":null,"name":"Kinnitatud","index":"Kinnitatud","editoptions":{"value":"True:False","readonly":"readonly","disabled":"disabled"},"template":"booleanCheckboxFa","editable":true,"width":0,"classes":null,"hidden":true,"searchoptions":{"sopt":["eq","ne"],"value":":Free;true:Yes;false:No"},"dataEvents":[{"type":"focus","fn":function(e) {if(typeof e.target.ischanged=='undefined') {e.target.ischanged=false}} },"",{"type":"click","fn":function(e) {dataChanged(e.target)} },{"type":"blur","fn":function(e) {summarefresh()} }]}], 在其他网格发布状态由Kinkuup列确定,未列入未发布文档的列: {"template":DateTemplate ,"label":null,"name":"Kinkuup","index":"Kinkuup","editoptions":{"dataInit":null,"size":10,"readonly":"readonly","disabled":"disabled"},"searchoptions":{"dataInit":initDateSearch ,"size":10,"attr":{"size":10}},"width":0,"classes":null,"hidden":true,"dataEvents":[]}], 这两列可以隐藏或在网格中可见。 取决于用户的喜好。 自定义操作button在所有行的loadComplete中创build: loadComplete: function() { var iCol = getColumnIndexByName($(this),'_actions'); $(this).children("tbody").children("tr.jqgrow") .children("td:nth-child("+(iCol+1)+")") .each(function() { $("<div>", { title: "Confirm (F2)", mouseover: […]
如何在jqgrid中保存当前行的代码 用于保存jqgrid状态。 它使用列号保存jqgrid列状态。 如果jqgrid colmodel在服务器中更改,这会导致在浏览器中的JavaScript错误。 在JQGrid注释中冻结rownum列和https://github.com/free-jqgrid/jqGrid/blob/master/README49.md描述方法remapColumnsByName 。 我希望使用这个修复问题。 免费的jqgrid是从今天的git master下载的。 在调整列大小或移动行后状态保存 saveColumnState.call($grid, $grid[0].p.remapColumns); 被改为 saveColumnState.call($grid, $grid[0].p.remapColumnsByName); 并在loadComplete代码中恢复状态 if (isColState && myColumnsState.permutation.length > 0 && myColumnsState.permutation.length === cm.length) { $grid.jqGrid("remapColumns", myColumnsState.permutation, true); } 同 if (isColState && myColumnsState.permutation.length > 0 && myColumnsState.permutation.length === cm.length) { $grid.jqGrid("remapColumnsByName", myColumnsState.permutation, true); } 现在行 if (isColState && myColumnsState.permutation.length > 0 […]