//navButtons jQuery(grid_selector).jqGrid('navGrid',pager_selector, { //navbar options edit: true, editicon : 'ace-icon fa fa-pencil blue', add: false, addicon : 'ace-icon fa fa-plus-circle purple', del: true, delicon : 'ace-icon fa fa-trash-o red', search: false, searchicon : 'ace-icon fa fa-search orange', refresh: true, refreshicon : 'ace-icon fa fa-refresh green', view: true, viewicon : 'ace-icon fa fa-search-plus grey', }, { //edit record form 修改 //closeAfterEdit: true, //width: 700, recreateForm: true, //初始化數據前提示 beforeInitData:function(e){ if ($('#runstatus45').val() == 1) { alert('運行狀態不能修改!'); return false; }else { return true; } }, beforeShowForm : function(e) { var form = $(e[0]); form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />') style_edit_form(form); }, afterSubmit: function (result) { //alert(result.responseText); var strTojson=JSON.parse(result.responseText);//.parseJSON() if(strTojson.status==='error') return [false,strTojson.m_msg] else { //addRowTd(); return [true,] } } }, { //new record form //width: 700, closeAfterAdd: true, recreateForm: true, viewPagerButtons: false, beforeShowForm : function(e) { var form = $(e[0]); form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar') .wrapInner('<div class="widget-header" />') style_edit_form(form); } , //提交數據時判斷 afterSubmit: function (result) { var strTojson=JSON.parse(result.responseText);//.parseJSON() //alert(strTojson.status); if(strTojson.status==='error') return [false,strTojson.m_msg] else { //addRowTd(); return [true,] } } }, { //delete record form recreateForm: true, beforeInitData:function(e){ if ($('#runstatus45').val() == 1) { alert('運行狀態不能刪除數據!'); return false; }else { return true; } }, beforeShowForm : function(e) { var form = $(e[0]); if(form.data('styled')) return false; form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />') style_delete_form(form); form.data('styled', true); }, afterSubmit: function (result) { var strTojson=JSON.parse(result.responseText);//.parseJSON() //alert(strTojson.status); if(strTojson.status==='error') return [false,strTojson.m_msg] else { addRowTd(); return [true,] } }, onClick : function(e) { alert(1); } }, { //search form recreateForm: true, afterShowSearch: function(e){ var form = $(e[0]); form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />') style_search_form(form); }, afterRedraw: function(){ style_search_filters($(this)); } , multipleSearch: true, /** multipleGroup:true, showQuery: true */ }, { //view record form recreateForm: true, beforeShowForm: function(e){ var form = $(e[0]); form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />') } } )
jggrid 使用中的一點記錄 點擊修改時判斷狀態或者一個前提條件
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.