⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grid.setcolumns-min.js

📁 news新闻系统. news新闻系统 news新闻系统
💻 JS
字号:
/**
 * jqGrid extension for manipulating columns properties
 * Piotr Roznicki roznicki@o2.pl
 */
;(function(a){a.fn.extend({setColumns:function(b){b=a.extend({top:0,left:0,width:200,height:195,modal:false,drag:true,closeicon:'ico-close.gif',beforeShowForm:null,afterShowForm:null,afterSubmitForm:null},a.jgrid.col,b||{});return this.each(function(){var c=this;if(!c.grid){return}var h=typeof b.beforeShowForm==='function'?true:false;var j=typeof b.afterShowForm==='function'?true:false;var k=typeof b.afterSubmitForm==='function'?true:false;if(!b.imgpath){b.imgpath=c.p.imgpath}var f=a("table:first",c.grid.bDiv).attr("id");var d={themodal:'colmod'+f,modalhead:'colhd'+f,modalcontent:'colcnt'+f};var e="ColTbl_"+f;if(a("#"+d.themodal).html()!=null){if(h){b.beforeShowForm(a("#"+e))}viewModal("#"+d.themodal,{modal:b.modal});if(j){b.afterShowForm(a("#"+e))}}else{var g=a("<table id='"+e+"' class='ColTable'><tbody></tbody></table>");for(i=0;i<this.p.colNames.length;i++){if(!c.p.colModel[i].hidedlg){a(g).append("<tr><td ><input type='checkbox' id='col_"+this.p.colModel[i].name+"' class='cbox' value='T' "+((this.p.colModel[i].hidden==undefined)?"checked":"")+"/><label for='col_"+this.p.colModel[i].name+"'>"+this.p.colNames[i]+"("+this.p.colModel[i].name+")</label></td></tr>")}}var l="<input id='dData' type='button' value='"+b.bSubmit+"'/>";var m="<input id='eData' type='button' value='"+b.bCancel+"'/>";a(g).append("<tr><td class='ColButton'>"+l+"&nbsp;"+m+"</td></tr>");createModal(d,g,b,c.grid.hDiv,c.grid.hDiv);if(b.drag){DnRModal("#"+d.themodal,"#"+d.modalhead+" td.modaltext")}a("#dData","#"+e).click(function(n){for(i=0;i<c.p.colModel.length;i++){if(!c.p.colModel[i].hidedlg){if(a("#col_"+c.p.colModel[i].name).attr("checked")){a(c).showCol(c.p.colModel[i].name);a("#col_"+c.p.colModel[i].name).attr("defaultChecked",true)}else{a(c).hideCol(c.p.colModel[i].name);a("#col_"+c.p.colModel[i].name).attr("defaultChecked","")}}}a("#"+d.themodal).jqmHide();if(k){b.afterSubmitForm(a("#"+e))}return false});a("#eData","#"+e).click(function(n){a("#"+d.themodal).jqmHide();return false});if(h){b.beforeShowForm(a("#"+e))}viewModal("#"+d.themodal,{modal:b.modal});if(j){b.afterShowForm(a("#"+e))}}})}})})(jQuery);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -