(function($) {Function.prototype.ligerExtend=function(parent,overrides) {if(typeof parent!='function')return this;this.base=parent.prototype;this.base.constructor=parent;var f=function(){};f.prototype=parent.prototype;this.prototype=new f();this.prototype.constructor=this;if(overrides)$.extend(this.prototype,overrides);};Function.prototype.ligerDefer=function(o,defer,args) {var fn=this;return setTimeout(function(){fn.apply(o,args||[]);},defer);};window.liger=$.ligerui={version:'V1.2.0',managerCount:0,managers:{},managerIdPrev:'ligerui',autoNewId:true,error:{managerIsExist:'������id�Ѿ�����'},pluginPrev:'liger',getId:function(prev) {prev=prev||this.managerIdPrev;var id=prev+(1000+this.managerCount);this.managerCount++;return id;},add:function(manager) {if(arguments.length==2) {var m=arguments[1];m.id=m.id||m.options.id||arguments[0].id;this.addManager(m);return;} if(!manager.id)manager.id=this.getId(manager.__idPrev());if(this.managers[manager.id])manager.id=this.getId(manager.__idPrev());if(this.managers[manager.id]) {throw new Error(this.error.managerIsExist);} this.managers[manager.id]=manager;},remove:function(arg) {if(typeof arg=="string"||typeof arg=="number") {delete liger.managers[arg];} else if(typeof arg=="object") {if(arg instanceof liger.core.Component) {delete liger.managers[arg.id];} else {if(!$(arg).attr(this.idAttrName))return false;delete liger.managers[$(arg).attr(this.idAttrName)];}}},get:function(arg,idAttrName) {idAttrName=idAttrName||"ligeruiid";if(typeof arg=="string"||typeof arg=="number") {return liger.managers[arg];} else if(typeof arg=="object") {var domObj=arg.length?arg[0]:arg;var id=domObj[idAttrName]||$(domObj).attr(idAttrName);if(!id)return null;return liger.managers[id];} return null;},find:function(type) {var arr=[];for(var id in this.managers) {var manager=this.managers[id];if(type instanceof Function) {if(manager instanceof type) {arr.push(manager);}} else if(type instanceof Array) {if($.inArray(manager.__getType(),type)!=-1) {arr.push(manager);}} else {if(manager.__getType()==type) {arr.push(manager);}}} return arr;},run:function(plugin,args,ext) {if(!plugin)return;ext=$.extend({defaultsNamespace:'ligerDefaults',methodsNamespace:'ligerMethods',controlNamespace:'controls',idAttrName:'ligeruiid',isStatic:false,hasElement:true,propertyToElemnt:null},ext||{});plugin=plugin.replace(/^ligerGet/,'');plugin=plugin.replace(/^liger/,'');if(this==null||this==window||ext.isStatic) {if(!liger.plugins[plugin]) {liger.plugins[plugin]={fn:$[liger.pluginPrev+plugin],isStatic:true};} return new $.ligerui[ext.controlNamespace][plugin]($.extend({},$[ext.defaultsNamespace][plugin]||{},$[ext.defaultsNamespace][plugin+'String']||{},args.length>0?args[0]:{}));} if(!liger.plugins[plugin]) {liger.plugins[plugin]={fn:$.fn[liger.pluginPrev+plugin],isStatic:false};} if(/Manager$/.test(plugin))return liger.get(this,ext.idAttrName);this.each(function() {if(this[ext.idAttrName]||$(this).attr(ext.idAttrName)) {var manager=liger.get(this[ext.idAttrName]||$(this).attr(ext.idAttrName));if(manager&&args.length>0)manager.set(args[0]);return;} if(args.length>=1&&typeof args[0]=='string')return;var options=args.length>0?args[0]:null;var p=$.extend({},$[ext.defaultsNamespace][plugin],$[ext.defaultsNamespace][plugin+'String'],options);if(ext.propertyToElemnt)p[ext.propertyToElemnt]=this;if(ext.hasElement) {new $.ligerui[ext.controlNamespace][plugin](this,p);} else {new $.ligerui[ext.controlNamespace][plugin](p);}});if(this.length==0)return null;if(args.length==0)return liger.get(this,ext.idAttrName);if(typeof args[0]=='object')return liger.get(this,ext.idAttrName);if(typeof args[0]=='string') {var manager=liger.get(this,ext.idAttrName);if(manager==null)return;if(args[0]=="option") {if(args.length==2) return manager.get(args[1]);else if(args.length>=3) return manager.set(args[1],args[2]);} else {var method=args[0];if(!manager[method])return;var parms=Array.apply(null,args);parms.shift();return manager[method].apply(manager,parms);}} return null;},defaults:{},methods:{},core:{},controls:{},plugins:{}};$.ligerDefaults={};$.ligerMethos={};liger.defaults=$.ligerDefaults;liger.methods=$.ligerMethos;$.fn.liger=function(plugin) {if(plugin) {return liger.run.call(this,plugin,arguments);} else {return liger.get(this);}};liger.core.Component=function(options) {this.events=this.events||{};this.options=options||{};this.children={};};$.extend(liger.core.Component.prototype,{__getType:function() {return'liger.core.Component';},__idPrev:function() {return'ligerui';},set:function(arg,value) {if(!arg)return;if(typeof arg=='object') {var tmp;if(this.options!=arg) {$.extend(this.options,arg);tmp=arg;} else {tmp=$.extend({},arg);} if(value==undefined||value==true) {for(var p in tmp) {if(p.indexOf('on')==0) this.set(p,tmp[p]);}} if(value==undefined||value==false) {for(var p in tmp) {if(p.indexOf('on')!=0) this.set(p,tmp[p]);}} return;} var name=arg;if(name.indexOf('on')==0) {if(typeof value=='function') this.bind(name.substr(2),value);return;} if(!this.options)this.options={};if(this.trigger('propertychange',[arg,value])==false)return;this.options[name]=value;var pn='_set'+name.substr(0,1).toUpperCase()+name.substr(1);if(this[pn]) {this[pn].call(this,value);} this.trigger('propertychanged',[arg,value]);},get:function(name) {var pn='_get'+name.substr(0,1).toUpperCase()+name.substr(1);if(this[pn]) {return this[pn].call(this,name);} return this.options[name];},hasBind:function(arg) {var name=arg.toLowerCase();var event=this.events[name];if(event&&event.length)return true;return false;},trigger:function(arg,data) {if(!arg)return;var name=arg.toLowerCase();var event=this.events[name];if(!event)return;data=data||[];if((data instanceof Array)==false) {data=[data];} for(var i=0;i").appendTo('body');$(window).bind('resize.ligeruiwin',setHeight);$(window).bind('scroll',setHeight);} this.windowMask.show();setHeight();this.masking=true;},unmask:function(win) {var jwins=$("body > .l-dialog:visible,body > .l-window:visible");for(var i=0,l=jwins.length;i
').appendTo('body');if(this.top)this.taskbar.addClass("l-taskbar-top");this.taskbar.tasks=$(".l-taskbar-tasks:first",this.taskbar);this.tasks={};} this.taskbar.show();this.taskbar.animate({bottom:0});return this.taskbar;},removeTaskbar:function() {var self=this;self.taskbar.animate({bottom:-32},function() {self.taskbar.remove();self.taskbar=null;});},activeTask:function(win) {for(var winid in this.tasks) {var t=this.tasks[winid];if(winid==win.id) {t.addClass("l-taskbar-task-active");} else {t.removeClass("l-taskbar-task-active");}}},getTask:function(win) {var self=this;if(!self.taskbar)return;if(self.tasks[win.id])return self.tasks[win.id];return null;},addTask:function(win) {var self=this;if(!self.taskbar)self.createTaskbar();if(self.tasks[win.id])return self.tasks[win.id];var title=win.get('title');var task=self.tasks[win.id]=$('
'+title+'
');self.taskbar.tasks.append(task);self.activeTask(win);task.bind('click',function() {self.activeTask(win);if(win.actived) win.min();else win.active();}).hover(function() {$(this).addClass("l-taskbar-task-over");},function() {$(this).removeClass("l-taskbar-task-over");});return task;},hasTask:function() {for(var p in this.tasks) {if(this.tasks[p]) return true;} return false;},removeTask:function(win) {var self=this;if(!self.taskbar)return;if(self.tasks[win.id]) {self.tasks[win.id].unbind();self.tasks[win.id].remove();delete self.tasks[win.id];} if(!self.hasTask()) {self.removeTaskbar();}},setFront:function(win) {var wins=liger.find(liger.core.Win);for(var i in wins) {var w=wins[i];if(w==win) {$(w.element).css("z-index","9200");this.activeTask(w);} else {$(w.element).css("z-index","9100");}}}};liger.core.Win=function(element,options) {liger.core.Win.base.constructor.call(this,element,options);};liger.core.Win.ligerExtend(liger.core.UIComponent,{__getType:function() {return'liger.controls.Win';},mask:function() {if(this.options.modal) liger.win.mask(this);},unmask:function() {if(this.options.modal) liger.win.unmask(this);},min:function() {},max:function() {},active:function() {}});liger.draggable={dragging:false};liger.resizable={reszing:false};liger.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o) {var f=function(n) {return n<10?'0'+n:n;},escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,quote=function(value) {escapable.lastIndex=0;return escapable.test(value)?'"'+value.replace(escapable,function(a) {var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+value+'"';};if(o===null)return'null';var type=typeof o;if(type==='undefined')return undefined;if(type==='string')return quote(o);if(type==='number'||type==='boolean')return''+o;if(type==='object') {if(typeof o.toJSON==='function') {return liger.toJSON(o.toJSON());} if(o.constructor===Date) {return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ f(this.getUTCMonth()+1)+'-'+ f(this.getUTCDate())+'T'+ f(this.getUTCHours())+':'+ f(this.getUTCMinutes())+':'+ f(this.getUTCSeconds())+'Z':null;} var pairs=[];if(o.constructor===Array) {for(var i=0,l=o.length;i");if(e.body) {inputBody=e.body.clone();} inputBody.appendTo(container);if(editParm.field) {var txtInputName=field.name;var prefixID=$.isFunction(options.prefixID)?options.prefixID(master):(options.prefixID||"");p.id=field.id||(prefixID+field.name);if($.inArray(type,["select","combobox","autocomplete","popup"])!=-1) {txtInputName=field.textField||field.comboboxName;if(field.comboboxName&&!field.id) p.id=(options.prefixID||"")+field.comboboxName;} if($.inArray(type,["select","combobox","autocomplete","popup","radiolist","checkboxlist","listbox"])!=-1) {p.valueFieldID=prefixID+field.name;} if(!e.body) {var inputName=prefixID+txtInputName;inputBody.attr($.extend({name:inputName},field.attr));if(field.cssClass) {inputBody.addClass(field.cssClass);} if(field.validate&&!master.options.unSetValidateAttr) {inputBody.attr('validate',liger.toJSON(field.validate));}} $.extend(p,field.options);} if(field.editor) {$.extend(p,field.editor.options);if(field.editor.valueColumnName)p.valueField=field.editor.valueColumnName;if(field.editor.displayColumnName)p.textField=field.editor.displayColumnName;if(control) {var defaults=liger.defaults[control];for(var proName in defaults) {if(proName in field.editor) {p[proName]=field.editor[proName];}}} var ext=field.editor.p||field.editor.ext;ext=typeof(ext)=='function'?ext(editParm):ext;$.extend(p,ext);} return inputBody['liger'+control](p);},getValue:function(editor,editParm) {if(editor.getValue) {return editor.getValue();}},setValue:function(editor,value,editParm) {if(editor.setValue) {editor.setValue(value);}},getText:function(editor,editParm) {if(editor.getText) {return editor.getText();}},setText:function(editor,value,editParm) {if(editor.setText) {editor.setText(value);}},getSelected:function(editor,editParm) {if(editor.getSelected) {return editor.getSelected();}},resize:function(editor,width,height,editParm) {if(editParm.field)width=width-2;if(editor.resize)editor.resize(width,height);},destroy:function(editor,editParm) {if(editor.destroy)editor.destroy();}},e);};liger.editors={"text":{control:'TextBox'},"date":{control:'DateEditor',setValue:function(editor,value,editParm) {if(typeof value=="string"&&/^\/Date/.test(value)) {value=value.replace(/^\//,"new ").replace(/\/$/,"");eval("value = "+value);} editor.setValue(value);}},"combobox":{control:'ComboBox'},"spinner":{control:'Spinner'},"checkbox":{control:'CheckBox'},"checkboxlist":{control:'CheckBoxList',body:$('
'),resize:function(editor,width,height,editParm) {editor.set('width',width-2);}},"radiolist":{control:'RadioList',body:$('
'),resize:function(editor,width,height,editParm) {editor.set('width',width-2);}},"listbox":{control:'ListBox',body:$('
'),resize:function(editor,width,height,editParm) {editor.set('width',width-2);}},"popup":{control:'PopupEdit'},"number":{control:'TextBox',options:{number:true}},"currency":{control:'TextBox',options:{currency:true}},"digits":{control:'TextBox',options:{digits:true}},"password":{control:'TextBox',password:true}};liger.editors["string"]=liger.editors["text"];liger.editors["select"]=liger.editors["combobox"];liger.editors["int"]=liger.editors["digits"];liger.editors["float"]=liger.editors["number"];liger.editors["chk"]=liger.editors["checkbox"];liger.editors["popupedit"]=liger.editors["popup"];$.fn.live=$.fn.on?$.fn.on:$.fn.live;if(!$.browser) {var userAgent=navigator.userAgent.toLowerCase();$.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:((/msie/.test(userAgent))||("ActiveXObject" in window))&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};}})(jQuery);(function($) {var l=$.ligerui;$.fn.ligerGrid=function(options) {return $.ligerui.run.call(this,"ligerGrid",arguments);};$.fn.ligerGetGridManager=function() {return $.ligerui.run.call(this,"ligerGetGridManager",arguments);};$.ligerDefaults.Grid={title:null,width:'auto',height:'auto',columnWidth:null,resizable:true,url:false,data:null,usePager:true,page:1,pageSize:10,pageSizeOptions:[10,20,30,40,50],parms:[],columns:[],minColToggle:1,dataType:'server',dataAction:'server',showTableToggleBtn:false,switchPageSizeApplyComboBox:false,allowAdjustColWidth:true,checkbox:false,allowHideColumn:true,enabledEdit:false,isScroll:true,dateFormat:'yyyy-MM-dd',inWindow:true,statusName:'__status',method:'post',async:true,fixedCellHeight:true,heightDiff:0,cssClass:null,root:'Rows',record:'Total',pageParmName:'page',pagesizeParmName:'pagesize',sortnameParmName:'sortname',sortorderParmName:'sortorder',allowUnSelectRow:false,alternatingRow:true,mouseoverRowCssClass:'l-grid-row-over',enabledSort:true,rowAttrRender:null,groupColumnName:null,groupColumnDisplay:'����',groupRender:null,totalRender:null,delayLoad:false,where:null,selectRowButtonOnly:false,whenRClickToSelect:false,contentType:null,checkboxColWidth:27,detailColWidth:29,clickToEdit:true,detailToEdit:false,onEndEdit:null,minColumnWidth:80,tree:null,isChecked:null,isSelected:null,frozen:true,frozenDetail:false,frozenCheckbox:true,detail:null,detailHeight:260,isShowDetailToggle:null,rownumbers:false,frozenRownumbers:true,rownumbersColWidth:26,colDraggable:false,rowDraggable:false,rowDraggingRender:null,autoCheckChildren:true,onRowDragDrop:null,rowHeight:28,headerRowHeight:30,toolbar:null,toolbarShowInLeft:true,headerImg:null,unSetValidateAttr:true,onDragCol:null,onToggleCol:null,onChangeSort:null,onSuccess:null,onDblClickRow:null,onSelectRow:null,onUnSelectRow:null,onBeforeCheckRow:null,onCheckRow:null,onBeforeCheckAllRow:null,onCheckAllRow:null,onBeforeShowData:null,onAfterShowData:null,onError:null,onSubmit:null,onReload:null,onToFirst:null,onToPrev:null,onToNext:null,onToLast:null,onAfterAddRow:null,onBeforeEdit:null,onBeforeSubmitEdit:null,onAfterEdit:null,onLoading:null,onLoaded:null,onContextmenu:null,onBeforeCancelEdit:null,onAfterSubmitEdit:null,onRowDragDrop:null,onGroupExtend:null,onGroupCollapse:null,onLoadData:null};$.ligerDefaults.GridString={errorMessage:'��������',pageStatMessage:'��ʾ��{from}��{to}���� {total} �� ��ÿҳ��ʾ��{pagesize}',pageTextMessage:'Page',loadingMessage:'������...',findTextMessage:'����',noRecordMessage:'û�з��������ļ�¼����',isContinueByDataChanged:'�����Ѿ��ı�,�����������ʧ����,�Ƿ����?',cancelMessage:'ȡ��',saveMessage:'����',applyMessage:'Ӧ��',draggingMessage:'{count}��'};$.ligerDefaults.Grid_columns={id:null,name:null,totalSummary:null,display:null,headerRender:null,isAllowHide:true,isSort:false,type:null,columns:null,width:120,minWidth:80,format:null,align:'left',hide:false,editor:null,render:null,textField:null};$.ligerDefaults.Grid_editor={type:null,ext:null,onChange:null,onChanged:null};$.ligerMethos.Grid=$.ligerMethos.Grid||{};$.ligerDefaults.Grid.sorters=$.ligerDefaults.Grid.sorters||{};$.ligerDefaults.Grid.formatters=$.ligerDefaults.Grid.formatters||{};$.ligerDefaults.Grid.editors=$.ligerDefaults.Grid.editors||{};$.ligerDefaults.Grid.sorters['date']=function(val1,val2) {return val1val2?1:0;};$.ligerDefaults.Grid.sorters['int']=function(val1,val2) {return parseInt(val1)parseInt(val2)?1:0;};$.ligerDefaults.Grid.sorters['float']=function(val1,val2) {return parseFloat(val1)parseFloat(val2)?1:0;};$.ligerDefaults.Grid.sorters['string']=function(val1,val2) {if(!val1)return false;return val1.localeCompare(val2);};$.ligerDefaults.Grid.formatters['date']=function(value,column) {function getFormatDate(date,dateformat) {var g=this,p=this.options;if(isNaN(date))return null;var format=dateformat;var o={"M+":date.getMonth()+1,"d+":date.getDate(),"h+":date.getHours(),"m+":date.getMinutes(),"s+":date.getSeconds(),"q+":Math.floor((date.getMonth()+3)/3),"S":date.getMilliseconds()} if(/(y+)/.test(format)) {format=format.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length));} for(var k in o) {if(new RegExp("("+k+")").test(format)) {format=format.replace(RegExp.$1,RegExp.$1.length==1?o[k]:("00"+o[k]).substr((""+o[k]).length));}} return format;} if(!value)return"";if(typeof(value)=="string"&&/^\/Date/.test(value)) {value=value.replace(/^\//,"new ").replace(/\/$/,"");eval("value = "+value);} if(value instanceof Date) {var format=column.format||this.options.dateFormat||"yyyy-MM-dd";return getFormatDate(value,format);} else {return value.toString();}};$.ligerui.controls.Grid=function(element,options) {$.ligerui.controls.Grid.base.constructor.call(this,element,options);};$.ligerui.controls.Grid.ligerExtend($.ligerui.core.UIComponent,{__getType:function() {return'$.ligerui.controls.Grid';},__idPrev:function() {return'grid';},_extendMethods:function() {return $.ligerMethos.Grid;},_init:function() {$.ligerui.controls.Grid.base._init.call(this);var g=this,p=this.options;p.dataType=p.url?"server":"local";if(p.dataType=="local") {p.data=p.data||[];p.dataAction="local";} if(p.isScroll==false) {p.height='auto';} if(!p.frozen) {p.frozenCheckbox=false;p.frozenDetail=false;p.frozenRownumbers=false;} if(p.detailToEdit) {p.enabledEdit=true;p.clickToEdit=false;p.detail={height:'auto',onShowDetail:function(record,container,callback) {$(container).addClass("l-grid-detailpanel-edit");g.beginEdit(record,function(rowdata,column) {var editContainer=$("
");editContainer.width(120).height(p.rowHeight+1);editContainer.appendTo(container);return editContainer;});function removeRow() {$(container).parent().parent().remove();g.collapseDetail(record);} $("
").appendTo(container);$("
"+p.saveMessage+"
").appendTo(container).click(function() {g.endEdit(record);removeRow();});$("
"+p.applyMessage+"
").appendTo(container).click(function() {g.submitEdit(record);});$("
"+p.cancelMessage+"
").appendTo(container).click(function() {g.cancelEdit(record);removeRow();});}};} if(p.tree) {p.tree.childrenName=p.tree.childrenName||"children";p.tree.isParent=p.tree.isParent||function(rowData) {var exist=p.tree.childrenName in rowData;return exist;};p.tree.isExtend=p.tree.isExtend||function(rowData) {if('isextend'in rowData&&rowData['isextend']==false) return false;return true;};} for(var type in liger.editors) {var editor=liger.editors[type];if(!editor||type in p.editors)continue;p.editors[type]=liger.getEditor($.extend({type:type,master:g},editor));}},_render:function() {var g=this,p=this.options;g.grid=$(g.element);g.grid.addClass("l-panel");var gridhtmlarr=[];gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
/
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");gridhtmlarr.push("
");g.grid.html(gridhtmlarr.join(''));g.header=$(".l-panel-header:first",g.grid);g.body=$(".l-panel-body:first",g.grid);g.toolbar=$(".l-panel-bar:first",g.grid);g.popup=$(".l-grid-popup:first",g.grid);g.gridloading=$(".l-grid-loading:first",g.grid);g.draggingline=$(".l-grid-dragging-line",g.grid);g.topbar=$(".l-panel-topbarinner:first",g.grid);g.gridview=$(".l-grid:first",g.grid);g.gridview.attr("id",g.id+"grid");g.gridview1=$(".l-grid1:first",g.gridview);g.gridview2=$(".l-grid2:first",g.gridview);g.gridheader=$(".l-grid-header:first",g.gridview2);g.gridbody=$(".l-grid-body:first",g.gridview2);g.f={};g.f.gridheader=$(".l-grid-header:first",g.gridview1);g.f.gridbody=$(".l-grid-body:first",g.gridview1);g.currentData=null;g.changedCells={};g.editors={};g.editor={editing:false};g.cacheData={};if(p.height=="auto") {g.bind("SysGridHeightChanged",function() {if(g.enabledFrozen()) g.gridview.height(Math.max(g.gridview1.height(),g.gridview2.height()));});} var pc=$.extend({},p);this._bulid();this._setColumns(p.columns);delete pc['columns'];delete pc['data'];delete pc['url'];g.set(pc);if(!p.delayLoad) {if(p.url) g.set({url:p.url});else if(p.data) g.set({data:p.data});}},_setFrozen:function(frozen) {if(frozen) this.grid.addClass("l-frozen");else this.grid.removeClass("l-frozen");},_setCssClass:function(value) {this.grid.addClass(value);},_setLoadingMessage:function(value) {this.gridloading.html(value);},_setToolbar:function(value) {var g=this,p=this.options;if(value&&$.fn.ligerToolBar) {g.topbar.parent().show();g.toolbarManager=g.topbar.ligerToolBar(value);if(value.title) {var jtitle=$("
"+value.title+"
");if(value.icon) {jtitle.append("");jtitle.addClass("l-panel-topbartitle-hasicon");} g.topbar.parent().append(jtitle);} if(p.toolbarShowInLeft) {g.topbar.addClass("l-panel-topbarinner-left");}}else {g.topbar.parent().remove();}},isHorizontalScrollShowed:function() {var g=this;var inner=g.gridbody.find(".l-grid-body-inner:first");if(!inner.length)return false;return g.gridbody.width()0) {g.gridbody.height(h);g.f.gridbody.height(h);var gridHeaderHeight=p.headerRowHeight*(g._columnMaxLevel-1)+p.headerRowHeight-1;g.gridview.height(h+gridHeaderHeight);} g._updateHorizontalScrollStatus.ligerDefer(g,10);},_calculateGridBodyHeight:function(h) {var g=this,p=this.options;if(typeof h=="string"&&h.indexOf('%')>0) {if(p.inWindow) h=$(window).height()*parseFloat(h)*0.01;else h=g.grid.parent().height()*parseFloat(h)*0.01;} if(p.title)h-=24;if(p.usePager)h-=32;if(p.totalRender)h-=25;if(p.toolbar)h-=g.topbar.outerHeight();var gridHeaderHeight=p.headerRowHeight*(g._columnMaxLevel-1)+p.headerRowHeight-1;h-=gridHeaderHeight;return h;},_updateHorizontalScrollStatus:function() {var g=this,p=this.options;if(g.isHorizontalScrollShowed()) {g.gridview.addClass("l-grid-hashorizontal");} else {g.gridview.removeClass("l-grid-hashorizontal");}},_updateFrozenWidth:function() {var g=this,p=this.options;if(g.enabledFrozen()) {g.gridview1.width(g.f.gridtablewidth);var view2width=g.gridview.width()-g.f.gridtablewidth;g.gridview2.css({left:g.f.gridtablewidth});if(view2width>0)g.gridview2.css({width:view2width});}},_setWidth:function(value) {var g=this,p=this.options;if(g.enabledFrozen())g._onResize();},_setUrl:function(value) {this.options.url=value;if(value) {this.options.dataType="server";this.loadData(true);} else {this.options.dataType="local";}},removeParm:function(name) {var g=this;var parms=g.get('parms');if(!parms)parms={};if(parms instanceof Array) {removeArrItem(parms,function(p){return p.name==name;});}else {delete parms[name];} g.set('parms',parms);},setParm:function(name,value) {var g=this;var parms=g.get('parms');if(!parms)parms={};if(parms instanceof Array) {removeArrItem(parms,function(p){return p.name==name;});parms.push({name:name,value:value});}else {parms[name]=value;} g.set('parms',parms);},_setData:function(value) {this.loadData(this.options.data);},loadData:function(loadDataParm) {var g=this,p=this.options;g.loading=true;g.trigger('loadData');var clause=null;var loadServer=true;if(typeof(loadDataParm)=="function") {clause=loadDataParm;if(g.lastData) {g.data=g.lastData;}else {g.data=g.currentData;if(!g.data)g.data={};if(!g.data[p.root])g.data[p.root]=[];g.lastData=g.data;} loadServer=false;} else if(typeof(loadDataParm)=="boolean") {loadServer=loadDataParm;} else if(typeof(loadDataParm)=="object"&&loadDataParm) {loadServer=false;p.dataType="local";p.data=loadDataParm;} if(!p.newPage)p.newPage=1;if(p.dataAction=="server") {if(!p.sortOrder)p.sortOrder="asc";} var param=[];if(p.parms) {var parms=$.isFunction(p.parms)?p.parms():p.parms;if(parms.length) {$(parms).each(function() {param.push({name:this.name,value:this.value});});} else if(typeof parms=="object") {for(var name in parms) {param.push({name:name,value:parms[name]});}}} if(p.dataAction=="server") {if(p.usePager) {param.push({name:p.pageParmName,value:p.newPage});param.push({name:p.pagesizeParmName,value:p.pageSize});} if(p.sortName) {param.push({name:p.sortnameParmName,value:p.sortName});param.push({name:p.sortorderParmName,value:p.sortOrder});}};$(".l-bar-btnload span",g.toolbar).addClass("l-disabled");if(p.dataType=="local") {g.filteredData=p.data||g.currentData;if(clause) g.filteredData[p.root]=g._searchData(g.filteredData[p.root],clause);if(p.usePager) g.currentData=g._getCurrentPageData(g.filteredData);else {g.currentData=g.filteredData;} g._convertTreeData();g._showData();} else if(p.dataAction=="local"&&!loadServer) {if(g.data&&g.data[p.root]) {g.filteredData=g.data;if(clause) g.filteredData[p.root]=g._searchData(g.filteredData[p.root],clause);g.currentData=g._getCurrentPageData(g.filteredData);g._convertTreeData();g._showData();}} else {g.loadServerData(param,clause);} g.loading=false;},_convertTreeData:function() {var g=this,p=this.options;if(p.tree&&p.tree.idField&&p.tree.parentIDField) {g.currentData[p.root]=g.arrayToTree(g.currentData[p.root],p.tree.idField,p.tree.parentIDField);g.currentData[p.record]=g.currentData[p.root].length;}},loadServerData:function(param,clause) {var g=this,p=this.options;var ajaxOptions={type:p.method,url:p.url,data:param,async:p.async,dataType:'json',beforeSend:function() {if(g.hasBind('loading')) {g.trigger('loading');} else {g.toggleLoading(true);}},success:function(data) {g.trigger('success',[data,g]);if(!data||!data[p.root]||!data[p.root].length) {g.currentData=g.data={};g.currentData[p.root]=g.data[p.root]=[];if(data&&data[p.record]) {g.currentData[p.record]=g.data[p.record]=data[p.record];}else {g.currentData[p.record]=g.data[p.record]=0;} g._convertTreeData();g._showData();return;} g.data=data;if(g.data[p.record]!=null&&g.cacheData.records) {g.cacheData.records=g.data[p.record];} if(p.dataAction=="server") {g.currentData=g.data;if(g.currentData[p.record]==null&&g.cacheData.records) {g.currentData[p.record]=g.cacheData.records;}} else {g.filteredData=g.data;if(clause)g.filteredData[p.root]=g._searchData(g.filteredData[p.root],clause);if(p.usePager) g.currentData=g._getCurrentPageData(g.filteredData);else g.currentData=g.filteredData;} g._convertTreeData();g._showData.ligerDefer(g,10,[g.currentData]);},complete:function() {g.trigger('complete',[g]);if(g.hasBind('loaded')) {g.trigger('loaded',[g]);} else {g.toggleLoading.ligerDefer(g,10,[false]);}},error:function(XMLHttpRequest,textStatus,errorThrown) {g.currentData=g.data={};g.currentData[p.root]=g.data[p.root]=[];g.currentData[p.record]=g.data[p.record]=0;g.toggleLoading.ligerDefer(g,10,[false]);$(".l-bar-btnload span",g.toolbar).removeClass("l-disabled");g.trigger('error',[XMLHttpRequest,textStatus,errorThrown]);}};if(p.contentType)ajaxOptions.contentType=p.contentType;$.ajax(ajaxOptions);},toggleLoading:function(show) {this.gridloading[show?'show':'hide']();},_createEditor:function(editorBuilder,container,editParm,width,height) {var editor=editorBuilder.create.call(this,container,editParm);if(editorBuilder.setValue) editorBuilder.setValue.call(this,editor,editParm.value,editParm);if(editorBuilder.setText&&editParm.column.textField) editorBuilder.setText.call(this,editor,editParm.text,editParm);if(editorBuilder.resize) editorBuilder.resize.call(this,editor,width,height,editParm);return editor;},beginEdit:function(rowParm,containerBulider) {var g=this,p=this.options;if(!p.enabledEdit||p.clickToEdit)return;var rowdata=g.getRow(rowParm);if(rowdata._editing)return;if(g.trigger('beginEdit',{record:rowdata,rowindex:rowdata['__index']})==false)return;g.editors[rowdata['__id']]={};rowdata._editing=true;g.reRender({rowdata:rowdata});containerBulider=containerBulider||function(rowdata,column) {var cellobj=g.getCellObj(rowdata,column);var container=$(cellobj).html("");g.setCellEditing(rowdata,column,true);return container;};for(var i=0,l=g.columns.length;i1)p.newPage=parseInt(p.page)-1;break;case'next':if(p.page>=p.pageCount)return;p.newPage=parseInt(p.page)+1;break;case'last':if(p.page>=p.pageCount)return;p.newPage=p.pageCount;break;case'input':var nv=parseInt($('.pcontrol input',g.toolbar).val());if(isNaN(nv))nv=1;if(nv<1)nv=1;else if(nv>p.pageCount)nv=p.pageCount;$('.pcontrol input',g.toolbar).val(nv);p.newPage=nv;break;} if(p.newPage==p.page)return false;if(p.newPage==1) {$(".l-bar-btnfirst span",g.toolbar).addClass("l-disabled");$(".l-bar-btnprev span",g.toolbar).addClass("l-disabled");} else {$(".l-bar-btnfirst span",g.toolbar).removeClass("l-disabled");$(".l-bar-btnprev span",g.toolbar).removeClass("l-disabled");} if(p.newPage==p.pageCount) {$(".l-bar-btnlast span",g.toolbar).addClass("l-disabled");$(".l-bar-btnnext span",g.toolbar).addClass("l-disabled");} else {$(".l-bar-btnlast span",g.toolbar).removeClass("l-disabled");$(".l-bar-btnnext span",g.toolbar).removeClass("l-disabled");} g.trigger('changePage',[p.newPage]);if(p.dataAction=="server") {g.loadData(p.where);} else {g.currentData=g._getCurrentPageData(g.filteredData);g._showData();}},getSelectedRow:function() {for(var i in this.selected) {var o=this.selected[i];if(o['__id']in this.records) return o;} return null;},getSelectedRows:function() {var arr=[];for(var i in this.selected) {var o=this.selected[i];if(o['__id']in this.records) arr.push(o);} return arr;},getSelectedRowObj:function() {for(var i in this.selected) {var o=this.selected[i];if(o['__id']in this.records) return this.getRowObj(o);} return null;},getSelectedRowObjs:function() {var arr=[];for(var i in this.selected) {var o=this.selected[i];if(o['__id']in this.records) arr.push(this.getRowObj(o));} return arr;},getCellObj:function(rowParm,column) {var rowdata=this.getRow(rowParm);column=this.getColumn(column);return document.getElementById(this._getCellDomId(rowdata,column));},getRowObj:function(rowParm,frozen) {var g=this,p=this.options;if(rowParm==null)return null;if(typeof(rowParm)=="string") {if(g._isRowId(rowParm)) return document.getElementById(g.id+(frozen?"|1|":"|2|")+rowParm);else return document.getElementById(g.id+(frozen?"|1|":"|2|")+g.rows[parseInt(rowParm)]['__id']);} else if(typeof(rowParm)=="number") {return document.getElementById(g.id+(frozen?"|1|":"|2|")+g.rows[rowParm]['__id']);} else if(typeof(rowParm)=="object"&&rowParm['__id']) {return g.getRowObj(rowParm['__id'],frozen);} return rowParm;},getRow:function(rowParm) {var g=this,p=this.options;if(rowParm==null)return null;if(typeof(rowParm)=="string") {if(g._isRowId(rowParm)) return g.records[rowParm];else return g.rows[parseInt(rowParm)];} else if(typeof(rowParm)=="number") {return g.rows[parseInt(rowParm)];} else if(typeof(rowParm)=="object"&&rowParm.nodeType==1&&!rowParm['__id']) {return g._getRowByDomId(rowParm.id);} return rowParm;},_setColumnVisible:function(column,hide) {var g=this,p=this.options;if(!hide) {column._hide=false;document.getElementById(column['__domid']).style.display="";if(column['__pid']!=-1) {var pcol=g._columns[column['__pid']];if(pcol._hide) {document.getElementById(pcol['__domid']).style.display="";this._setColumnVisible(pcol,hide);}}} else {column._hide=true;document.getElementById(column['__domid']).style.display="none";if(column['__pid']!=-1) {var hideall=true;var pcol=this._columns[column['__pid']];for(var i=0;pcol&&i div.l-grid-row-cell-inner:first").css('width',newwidth-8);g._updateFrozenWidth();g._updateHorizontalScrollStatus.ligerDefer(g,10);g.trigger('afterChangeColumnWidth',[column,newwidth]);},changeHeaderText:function(columnparm,headerText) {var g=this,p=this.options;var column;if(typeof(columnparm)=="number") {column=g.columns[columnparm];} else if(typeof(columnparm)=="object"&&columnparm['__id']) {column=columnparm;} else if(typeof(columnparm)=="string") {if(g._isColumnId(columnparm)) {column=g._columns[columnparm];} else {$(g.columns).each(function() {if(this.name==columnparm) g.changeHeaderText(this,headerText);});return;}} if(!column)return;var columnindex=column['__leafindex'];var headercell=document.getElementById(column['__domid']);$(".l-grid-hd-cell-text",headercell).html(headerText);if(p.allowHideColumn) {$(':checkbox[columnindex='+columnindex+"]",g.popup).parent().next().html(headerText);}},changeCol:function(from,to,isAfter) {var g=this,p=this.options;if(!from||!to)return;var fromCol=g.getColumn(from);var toCol=g.getColumn(to);fromCol.frozen=toCol.frozen;var fromColIndex,toColIndex;var fromColumns=fromCol['__pid']==-1?p.columns:g._columns[fromCol['__pid']].columns;var toColumns=toCol['__pid']==-1?p.columns:g._columns[toCol['__pid']].columns;fromColIndex=$.inArray(fromCol,fromColumns);toColIndex=$.inArray(toCol,toColumns);var sameParent=fromColumns==toColumns;var sameLevel=fromCol['__level']==toCol['__level'];toColumns.splice(toColIndex+(isAfter?1:0),0,fromCol);if(!sameParent) {fromColumns.splice(fromColIndex,1);} else {if(isAfter)fromColumns.splice(fromColIndex,1);else fromColumns.splice(fromColIndex+1,1);} g._setColumns(p.columns);g.reRender();},collapseDetail:function(rowParm) {var g=this,p=this.options;var rowdata=g.getRow(rowParm);if(!rowdata)return;for(var i=0,l=g.columns.length;i td > div > .l-grid-tree-space:last",rowobjs).addClass("l-grid-tree-link l-grid-tree-link-open");},demotion:function(rowParm) {var g=this,p=this.options;var rowdata=g.getRow(rowParm);if(!rowdata||!p.tree)return;var rowobjs=[g.getRowObj(rowdata)];if(g.enabledFrozen())rowobjs.push(g.getRowObj(rowdata,true));$("> td > div > .l-grid-tree-space:last",rowobjs).removeClass("l-grid-tree-link l-grid-tree-link-open l-grid-tree-link-close");if(g.hasChildren(rowdata)) {var children=g.getChildren(rowdata);for(var i=0,l=children.length;i").addClass("l-panel-header-hasicon");} else {g.header.hide();} if(p.toolbar) {if($.fn.ligerToolBar) g.toolbarManager=g.topbar.ligerToolBar(p.toolbar);} else {g.topbar.parent().remove();}},_createColumnId:function(column) {if(column.id!=null&&column.id!="")return column.id.toString();return"c"+(100+this._columnCount);},_isColumnId:function(str) {return(str in this._columns);},_initColumns:function() {var g=this,p=this.options;g._columns={};g._columnCount=0;g._columnLeafCount=0;g._columnMaxLevel=1;if(!p.columns)return;function removeProp(column,props) {for(var i in props) {if(props[i]in column) delete column[props[i]];}} function setColumn(column,level,pid,previd) {removeProp(column,['__id','__pid','__previd','__nextid','__domid','__leaf','__leafindex','__level','__colSpan','__rowSpan']);if(level>g._columnMaxLevel)g._columnMaxLevel=level;g._columnCount++;column['__id']=g._createColumnId(column);column['__domid']=g.id+"|hcell|"+column['__id'];g._columns[column['__id']]=column;if(!column.columns||!column.columns.length) column['__leafindex']=g._columnLeafCount++;column['__level']=level;column['__pid']=pid;column['__previd']=previd;if(!column.columns||!column.columns.length) {column['__leaf']=true;return 1;} var leafcount=0;var newid=-1;for(var i=0,l=column.columns.length;i1) {col['__colSpan']=col['__leafcount'];} if(col['__leaf']&&col['__level']!=g._columnMaxLevel) {col['__rowSpan']=g._columnMaxLevel-col['__level']+1;}} g.columns=g.getColumns();$(g.columns).each(function(i,column) {column.columnname=column.name;column.columnindex=i;column.type=column.type||"string";column.islast=i==g.columns.length-1;column.isSort=column.isSort==false?false:true;column.frozen=column.frozen?true:false;column._width=g._getColumnWidth(column);column._hide=column.hide?true:false;});},_getColumnWidth:function(column) {var g=this,p=this.options;if(column._width)return column._width;var colwidth=column.width||p.columnWidth;if(!colwidth||colwidth=="auto") {var autoColumnNumber=0,noAutoColumnWidth=0;$(g.columns).each(function(i,col) {var colwidth=col.width||p.columnWidth;var isAuto=(!colwidth||colwidth=="auto")?true:false;if(isAuto)autoColumnNumber++;else noAutoColumnWidth+=(parseFloat(g._getColumnWidth(col))+1);});colwidth=parseFloat((g.grid.width()-noAutoColumnWidth)/autoColumnNumber)-1;} if(typeof(colwidth)=="string"&&colwidth.indexOf('%')>0) {column._width=colwidth=parseInt(parseInt(colwidth)*0.01*(g.grid.width()-g.columns.length));} if(column.minWidth&&colwidthcolumn.maxWidth)colwidth=column.maxWidth;return colwidth;},_createHeaderCell:function(column) {var g=this,p=this.options;var jcell=$("
");jcell.attr("id",column['__domid']);if(!column['__leaf']) jcell.addClass("l-grid-hd-cell-mul");if(column.columnindex==g.columns.length-1) {jcell.addClass("l-grid-hd-cell-last");} if(column.isrownumber) {jcell.addClass("l-grid-hd-cell-rownumbers");jcell.html("
");} if(column.ischeckbox) {jcell.addClass("l-grid-hd-cell-checkbox");jcell.html("
");} if(column.isdetail) {jcell.addClass("l-grid-hd-cell-detail");jcell.html("
");} if(column.heightAlign) {$(".l-grid-hd-cell-inner:first",jcell).css("textAlign",column.heightAlign);} if(column['__colSpan'])jcell.attr("colSpan",column['__colSpan']);if(column['__rowSpan']) {jcell.attr("rowSpan",column['__rowSpan']);jcell.height(p.headerRowHeight*column['__rowSpan']);var paddingTop=(p.headerRowHeight*column['__rowSpan']-p.headerRowHeight)/2-5;$(".l-grid-hd-cell-inner:first",jcell).css("paddingTop",paddingTop);}else {jcell.height(p.headerRowHeight);} if(column['__leaf']) {jcell.width(column['_width']);jcell.attr("columnindex",column['__leafindex']);} var cellHeight=jcell.height();if(!column['__rowSpan']&&cellHeight>10)$(">div:first",jcell).height(cellHeight);if(column._hide)jcell.hide();if(column.name)jcell.attr({columnname:column.name});var headerText="";if(column.display&&column.display!="") headerText=column.display;else if(column.headerRender) headerText=column.headerRender(column);else headerText=" ";$(".l-grid-hd-cell-text:first",jcell).html(headerText);if(!column.issystem&&column['__leaf']&&column.resizable!==false&&$.fn.ligerResizable&&p.allowAdjustColWidth) {g.colResizable[column['__id']]=jcell.ligerResizable({handles:'e',onStartResize:function(e,ev) {this.proxy.hide();g.draggingline.css({height:g.body.height(),top:0,left:ev.pageX-g.grid.offset().left+parseInt(g.body[0].scrollLeft)}).show();},onResize:function(e,ev) {g.colresizing=true;g.draggingline.css({left:ev.pageX-g.grid.offset().left+parseInt(g.body[0].scrollLeft)});$('body').add(jcell).css('cursor','e-resize');},onStopResize:function(e) {g.colresizing=false;$('body').add(jcell).css('cursor','default');g.draggingline.hide();g.setColumnWidth(column,parseInt(column._width)+e.diffX);return false;}});} return jcell;},_initBuildGridHeader:function() {var g=this,p=this.options;g.gridtablewidth=0;g.f.gridtablewidth=0;if(g.colResizable) {for(var i in g.colResizable) {g.colResizable[i].destroy();} g.colResizable=null;} g.colResizable={};$("tbody:first",g.gridheader).html("");$("tbody:first",g.f.gridheader).html("");for(var level=1;level<=g._columnMaxLevel;level++) {var columns=g.getColumns(level);var islast=level==g._columnMaxLevel;var tr=$("");var trf=$("");if(!islast)tr.add(trf).addClass("l-grid-hd-mul");$("tbody:first",g.gridheader).append(tr);$("tbody:first",g.f.gridheader).append(trf);$(columns).each(function(i,column) {(column.frozen?trf:tr).append(g._createHeaderCell(column));if(column['__leaf']) {var colwidth=column['_width'];if(!column.frozen) g.gridtablewidth+=(parseInt(colwidth)?parseInt(colwidth):0)+1;else g.f.gridtablewidth+=(parseInt(colwidth)?parseInt(colwidth):0)+1;}});} if(g._columnMaxLevel>0) {var h=p.headerRowHeight*g._columnMaxLevel;g.gridheader.add(g.f.gridheader).height(h);if(p.rownumbers&&p.frozenRownumbers)g.f.gridheader.find("td:first").height(h);} g._updateFrozenWidth();$("div:first",g.gridheader).width(g.gridtablewidth+40);},_initBuildPopup:function() {var g=this,p=this.options;$(':checkbox',g.popup).unbind();$('tbody tr',g.popup).remove();$(g.columns).each(function(i,column) {if(column.issystem)return;if(column.isAllowHide==false)return;var chk='checked="checked"';if(column._hide)chk='';var header=column.display;$('tbody',g.popup).append(''+header+'');});if($.fn.ligerCheckBox) {$('input:checkbox',g.popup).ligerCheckBox({onBeforeClick:function(obj) {if(!obj.checked)return true;if($('input:checked',g.popup).length<=p.minColToggle) return false;return true;}});} if(p.allowHideColumn) {$('tr',g.popup).hover(function() {$(this).addClass('l-popup-row-over');},function() {$(this).removeClass('l-popup-row-over');});var onPopupCheckboxChange=function() {if($('input:checked',g.popup).length+1<=p.minColToggle) {return false;} g.toggleCol(parseInt($(this).attr("columnindex")),this.checked,true);};if($.fn.ligerCheckBox) $(':checkbox',g.popup).bind('change',onPopupCheckboxChange);else $(':checkbox',g.popup).bind('click',onPopupCheckboxChange);}},_initHeight:function() {var g=this,p=this.options;if(p.height=='auto') {g.gridbody.height('auto');g.f.gridbody.height('auto');} if(p.width) {g.grid.width(p.width);} g._onResize.call(g);},_initFootbar:function() {var g=this,p=this.options;if(p.usePager) {var optStr="";var selectedIndex=-1;$(p.pageSizeOptions).each(function(i,item) {var selectedStr="";if(p.pageSize==item)selectedIndex=i;optStr+="";});$('.l-bar-selectpagesize',g.toolbar).append("");if(selectedIndex!=-1)$('.l-bar-selectpagesize select',g.toolbar)[0].selectedIndex=selectedIndex;if(p.switchPageSizeApplyComboBox&&$.fn.ligerComboBox) {$(".l-bar-selectpagesize select",g.toolbar).ligerComboBox({onBeforeSelect:function() {if(p.url&&g.isDataChanged&&!confirm(p.isContinueByDataChanged)) return false;return true;},width:45});}} else {g.toolbar.hide();}},_searchData:function(data,clause) {var g=this,p=this.options;var newData=new Array();for(var i=0;i'];if(g.enabledGroup()) {var groups=[];var groupsdata=[];g.groups=groupsdata;for(var rowparm in data) {var item=data[rowparm];var groupColumnValue=item[p.groupColumnName];var valueIndex=$.inArray(groupColumnValue,groups);if(valueIndex==-1) {groups.push(groupColumnValue);valueIndex=groups.length-1;groupsdata.push([]);} groupsdata[valueIndex].push(item);} $(groupsdata).each(function(i,item) {if(groupsdata.length==1) gridhtmlarr.push('');gridhtmlarr.push('');gridhtmlarr.push('');gridhtmlarr.push(g._getHtmlFromData(item,frozen));if(g.isTotalSummary()) gridhtmlarr.push(g._getTotalSummaryHtml(item,"l-grid-totalsummary-group",frozen));});} else {gridhtmlarr.push(g._getHtmlFromData(data,frozen));} gridhtmlarr.push('
');gridhtmlarr.push('    ');if(p.groupRender) gridhtmlarr.push(p.groupRender(groups[i],item,p.groupColumnDisplay));else gridhtmlarr.push(p.groupColumnDisplay+':'+groups[i]);gridhtmlarr.push('
');(frozen?g.f.gridbody:g.gridbody).html(gridhtmlarr.join(''));if(!g.enabledGroup()) {g._bulidTotalSummary(frozen);} $("> div:first",g.gridbody).width(g.gridtablewidth);g._onResize();},_showData:function() {var g=this,p=this.options;g.changedCells={};var data=g.currentData[p.root];if(p.usePager) {if(p.dataAction=="server"&&g.data&&g.data[p.record]) p.total=g.data[p.record];else if(g.filteredData&&g.filteredData[p.root]) p.total=g.filteredData[p.root].length;else if(g.data&&g.data[p.root]) p.total=g.data[p.root].length;else if(data) p.total=data.length;p.page=p.newPage;if(!p.total)p.total=0;if(!p.page)p.page=1;p.pageCount=Math.ceil(p.total/p.pageSize);if(!p.pageCount)p.pageCount=1;g._buildPager();} $('.l-bar-btnloading:first',g.toolbar).removeClass('l-bar-btnloading');if(g.trigger('beforeShowData',[g.currentData])==false)return;g._clearGrid();g.isDataChanged=false;if(!data||!data.length) {g.gridview.addClass("l-grid-empty");$("
").addClass("l-grid-body-inner").appendTo(g.gridbody).css({width:g.gridheader.find(">div:first").width(),height:g.gridbody.height()});g._onResize.ligerDefer(g,50);return;} else {g.gridview.removeClass("l-grid-empty");} $(".l-bar-btnload:first span",g.toolbar).removeClass("l-disabled");g._updateGridData();if(g.enabledFrozen()) g._fillGridBody(g.rows,true);g._fillGridBody(g.rows,false);g.trigger('SysGridHeightChanged');if(p.totalRender) {$(".l-panel-bar-total",g.element).remove();$(".l-panel-bar",g.element).before('
'+p.totalRender(g.data,g.filteredData)+'
');} if(p.mouseoverRowCssClass) {for(var i in g.rows) {var rowobj=$(g.getRowObj(g.rows[i]));if(g.enabledFrozen()) rowobj=rowobj.add(g.getRowObj(g.rows[i],true));rowobj.bind('mouseover.gridrow',function() {g._onRowOver(this,true);}).bind('mouseout.gridrow',function() {g._onRowOver(this,false);});}} g._fixHeight();g.gridbody.trigger('scroll.grid');g.trigger('afterShowData',[g.currentData]);},_fixHeight:function() {var g=this,p=this.options;if(p.fixedCellHeight||!p.frozen)return;var column1,column2;for(var i in g.columns) {var column=g.columns[i];if(column1&&column2)break;if(column.frozen&&!column1) {column1=column;continue;} if(!column.frozen&&!column2) {column2=column;continue;}} if(!column1||!column2)return;for(var rowid in g.records) {var cell1=g.getCellObj(rowid,column1),cell2=g.getCellObj(rowid,column2);var height=Math.max($(cell1).height(),($(cell2).height()));$(cell1).add(cell2).height(height);}},_getRowDomId:function(rowdata,frozen) {return this.id+"|"+(frozen?"1":"2")+"|"+rowdata['__id'];},_getCellDomId:function(rowdata,column) {return this._getRowDomId(rowdata,column.frozen)+"|"+column['__id'];},_getHtmlFromData:function(data,frozen) {if(!data)return"";var g=this,p=this.options;var gridhtmlarr=[];for(var i=0,l=data.length;i