text: /** 
   * generate-uui v3.0.0
   * 合并构建UUI
   * author : guoyongfeng
   * homepage : https://github.com/iuap-design/generate-uui#readme
   * bugs : https://github.com/iuap-design/generate-uui/issues
   **/ 
  !function($,window,document,undefined){var gridBrowser={},userAgent=navigator.userAgent,ua=userAgent.toLowerCase(),s;if((s=ua.match(/msie ([\d.]+)/))&&(gridBrowser.isIE=!0),gridBrowser.isIE){var mode=document.documentMode;null==mode||(8==mode?gridBrowser.isIE8=!0:9==mode&&(gridBrowser.isIE9=!0))}var dataSource=function(t,i){this.init(t,i),this.sortRows()},gridCompColumn=function(t,i){this.init(t,i)},gridComp=function(t,i){this.init(t,i),this.initGrid()};gridComp.prototype={init:function(t,i){this.dataSource=dataSource,this.gridCompColumn=gridCompColumn,this.ele=t[0],this.$ele=t,this.initDefault(),this.options=$.extend({},this.defaults,i),this.getBooleanOptions(),this.transDefault={ml_show_column:"显示/隐藏列",ml_clear_set:"清除设置",ml_no_rows:"无数据",ml_sum:"合计:",ml_close:"关闭"},this.transMap=$.extend({},this.transDefault,i.transMap),this.gridCompColumnFixedArr=new Array,this.gridCompColumnArr=new Array,this.countContentHeight=!0,this.minColumnWidth=80,this.scrollBarHeight=16,this.numWidth=40,this.multiSelectWidth=40,this.multiWidth=40,this.basicGridCompColumnArr=new Array,this.columnMenuWidth=160,this.columnMenuHeight=33,this.gridCompColumnFixedArr=new Array,this.gridCompLevelColumn=new Array,this.headerHeight=44*parseInt(this.options.maxHeaderLevel)+1,this.gridCompHiddenLevelColumnArr=new Array,this.treeLeft=10},getBooleanOptions:function(){this.options.cancelFocus=this.getBoolean(this.options.cancelFocus),this.options.showHeader=this.getBoolean(this.options.showHeader),this.options.showNumCol=this.getBoolean(this.options.showNumCol),this.options.multiSelect=this.getBoolean(this.options.multiSelect),this.options.columnMenu=this.getBoolean(this.options.columnMenu),this.options.canDrag=this.getBoolean(this.options.canDrag),this.options.overWidthHiddenColumn=this.getBoolean(this.options.overWidthHiddenColumn),this.options.sortable=this.getBoolean(this.options.sortable),this.options.showSumRow=this.getBoolean(this.options.showSumRow),this.options.canSwap=this.getBoolean(this.options.canSwap),this.options.showTree=this.getBoolean(this.options.showTree),this.options.autoExpand=this.getBoolean(this.options.autoExpand),this.options.needTreeSort=this.getBoolean(this.options.needTreeSort)},initDefault:function(){this.defaults={id:"grid",editType:"default",cancelFocus:!1,showHeader:!0,showNumCol:!1,multiSelect:!1,columnMenu:!0,canDrag:!0,formMaxWidth:300,maxHeaderLevel:1,overWidthHiddenColumn:!1,sortable:!0,showSumRow:!1,canSwap:!0,showTree:!1,autoExpand:!0,needTreeSort:!1}},initGrid:function(){if(this.options.columns&&0!=this.options.columns.length){var t=this;this.initOptions(),this.initVariable(),this.initWidthVariable(),this.initGridCompColumn(),this.initDataSource(),this.createDivs(),this.inte=setInterval(function(){t.setIntervalFun.call(t)},300)}},destroySelf:function(){clearInterval(this.inte),this.$ele.data("gridComp",null),this.ele.innerHTML=""},initOptions:function(){this.options.width=this.formatWidth(this.options.width),this.options.height=this.formatWidth(this.options.height),"100%"!=this.options.height&&this.options.height||(this.countContentHeight=!1),this.initOptionsTree(),this.leftW=0,this.options.showNumCol&&(this.leftW+=this.numWidth),this.options.multiSelect&&(this.leftW+=this.multiWidth),this.exceptContentHeight=0,this.options.showHeader&&(this.exceptContentHeight+=this.headerHeight),this.fixedWidth=0,this.options.maxHeaderLevel>1&&(this.options.canSwap=!1);var t=window.location.href,i=t.indexOf("?");i>0&&(t=t.substring(0,i)),this.localStorageId=this.options.id+t},initOptionsTree:function(){},initVariable:function(){this.initDataSourceVariable(),this.mouseUpX="mouseUpX",this.mouseUpY="mouseUpY",this.mouseDownX="mouseDownX",this.mouseDownY="mouseDownY",this.mouseMoveX="mouseMoveX",this.mouseMoveY="mouseMoveY",this.scrollLeft=0,this.scrollTop=0,this.showType="",this.createGridFlag=!1,this.columnClickX=0,this.columnClickY=0,this.columnMenuMove=!1,this.firstColumn=!0,this.lastVisibleColumn=null,this.lastVisibleColumnWidth=0,this.columnMenuMove=!1,this.createColumnMenuFlag=!1,this.menuColumnsHeight=0,this.createFormFlag=!1,this.$sd_storageData=null},initDataSourceVariable:function(){this.selectRows=new Array,this.selectRowsObj=new Array,this.selectRowsIndex=new Array,this.allRows=new Array,this.eidtRowIndex=-1},initWidthVariable:function(){this.wholeWidth=0,this.wholeHeight=0,this.rowHeight=0,this.contentRealWidth=0,this.contentWidth=0,this.contentMinWidth=0,this.contentHeight=0,this.fixedRealWidth=0,this.fixedWidth=0},initGridCompColumn:function(){var t=this;this.initGridCompColumnVar(),this.options.columns&&$.each(this.options.columns,function(i){t.initGridCompColumnFun(this)}),this.initGridCompColumnLoacl(),this.initGridHiddenLevelColumn(),this.initGridCompFixedColumn(),this.columnsVisibleFun()},initGridCompColumnVar:function(){this.gridCompColumnArr=new Array,this.basicGridCompColumnArr=new Array,this.gridCompColumnFixedArr=new Array,this.gridCompLevelColumn=new Array,this.gridCompHiddenLevelColumnArr=new Array},initGridCompColumnFun:function(t){var i=new gridCompColumn(t,this);i.options.realWidth=i.options.width,this.gridCompColumnArr.push(i),this.initGridCompColumnColumnMenuFun(t),this.initGridCompColumnHeaderLevelFun(t)},initGridCompColumnColumnMenuFun:function(t){},initGridCompColumnHeaderLevelFun:function(t){},initGridCompColumnLoacl:function(t){},initGridHiddenLevelColumn:function(){},initGridCompFixedColumn:function(){},setRequired:function(t,i){},initDataSource:function(){this.dataSourceObj=new dataSource(this.options.dataSource,this)},createDivs:function(){var t="",i="";this.ele.innerHTML="",i+=this.options.width?"width:"+this.options.width+";":"width:auto;",i+=this.options.height?"max-height:"+this.options.height+";":"height:auto;",""!=i&&(t='style="'+i+'"');var e='<div id="'+this.options.id+'" data-role="grid" class="u-grid" '+t+">";e+="</div>",this.ele.insertAdjacentHTML("afterBegin",e);var e='<div id="'+this.options.id+'_top" class="u-grid-top"></div>';document.body.appendChild($(e)[0]),this.initEventFun(),this.widthChangeFun()},repaintDivs:function(){this.repaintGridDivs(),this.realtimeTableRows=null},createGridDivs:function(){if(!this.createGridFlag){$("#"+this.options.id)[0]&&($("#"+this.options.id)[0].innerHTML="");var t='<div id="'+this.options.id+'_grid" class="u-grid-grid">';t+=this.createColumnMenu(),t+=this.createHeader(),t+=this.createContent(),t+="</div>",$("#"+this.options.id)[0]&&$("#"+this.options.id).html(t),this.headerFirstClassFun(),this.initGridEventFun(),this.showType="grid",this.afterGridDivsCreate(),this.createGridFlag=!0,this.realtimeTableRows=null}},repaintGridDivs:function(){$("#"+this.options.id+"_grid").remove(null,!0),this.showType="",this.wholeWidth=0,this.createGridFlag=!1,this.columnsVisibleFun(),this.widthChangeFun(),this.realtimeTableRows=null},createColumnMenu:function(){return""},createHeader:function(){var t="",i="";this.options.showHeader||(i='style="display:none;"');var e='<div class="u-grid-header" id="'+this.options.id+'_header" '+i+'><div class="u-grid-header-wrap" id="'+this.options.id+'_header_wrap" data-role="resizable" '+t+">";return e+='<div class="u-grid-header-columnmenu uf uf-reorderoption"></div>',(this.options.multiSelect||this.options.showNumCol)&&(e+='<div id="'+this.options.id+'_header_left" class="u-grid-header-left" style="width:'+this.leftW+'px;">',this.options.multiSelect&&(e+=gridBrowser.isIE8?'<div class="u-grid-header-multi-select" style="width:'+this.multiWidth+'px;"><span class="u-grid-checkbox-outline" id="'+this.options.id+'_header_multi_input"><span class="u-grid-checkbox-tick-outline"></span></span></div>':'<div class="u-grid-header-multi-select  checkbox check-success" style="width:'+this.multiWidth+'px;"><span class="u-grid-checkbox-outline" id="'+this.options.id+'_header_multi_input"><span class="u-grid-checkbox-tick-outline"></span></span></div>'),this.options.showNumCol&&(e+='<div class="u-grid-header-num" style="width:'+this.numWidth+'px;"></div>'),e+="</div>"),e+=this.createHeaderTableFixed(),e+=this.createHeaderTable(),e+="</div>",e+=this.createHeaderDrag(),e+="</div>"},createHeaderTable:function(t){var i,e,o;"fixed"==t?(i=parseInt(this.leftW),e="absolute;width:"+this.fixedWidth+"px;z-index:11;background:#F9F9F9;",o="fixed_"):(i=parseInt(this.leftW)+parseInt(this.fixedWidth),e="relative;",o="",this.contentMinWidth>0&&(e+="width:"+this.contentMinWidth+"px;"));var n='<table role="grid" id="'+this.options.id+"_header_"+o+'table" style="position:'+e+";left:"+i+'px">';return n+=this.createColgroup(t),n+='<thead role="rowgroup" id="'+this.options.id+"_header_"+o+'thead">',n+=this.createThead(t),n+="</thead></table>"},createHeaderTableFixed:function(){return""},createHeaderDrag:function(){return""},createColgroup:function(t){var i,e=this,o="<colgroup>";return i="fixed"==t?this.gridCompColumnFixedArr:this.gridCompColumnArr,$.each(i,function(){this.options.visible&&(o+="<col",o+=' style="width:'+e.formatWidth(this.options.width)+'"',o+=">")}),o+="</colgroup>"},createThead:function(t){var i,e=0,o="";this.options.maxHeaderLevel>1&&(o='style="height:'+this.headerHeight+'px;"');var n='<tr role="row" '+o+">";return i="fixed"==t?this.gridCompColumnFixedArr:this.gridCompColumnArr,$.each(i,function(t){var i=e,o="";0==this.options.visible?(i=-1,o='style="display:none;"'):e++,n+='<th role="columnheader" data-filed="'+this.options.field+'" rowspan="1" class="u-grid-header-th" '+o+'field="'+this.options.field+'" index="'+t+'" visibleIndex="'+i+'"><div style="position:relative;">';var s="";this.options.headerColor&&(s='style="color:'+this.options.headerColor+'"'),n+='<div class="u-grid-header-link" field="'+this.options.field+'" title="'+this.options.title+'" '+s+">"+this.options.title+"</div>",n+="</div></th>"}),n+="</tr>"},createContent:function(){var t="",i="",e="";if(this.countContentHeight){var o=$("#"+this.options.id)[0].offsetHeight;this.wholeHeight=o,o>0&&(this.contentHeight=parseInt(o)-this.exceptContentHeight-1>0?parseInt(o)-this.exceptContentHeight-1:0,this.contentHeight>0&&(t='style="height:'+this.contentHeight+'px;"'))}var n='<div id="'+this.options.id+'_content" class="u-grid-content" '+t+">";return(this.options.showNumCol||this.options.multiSelect)&&(n+=this.createContentLeft(),this.contentWidth>this.contentMinWidth||(i="display:none;",e="bottom:0px;"),n+=this.createContentSumRow(e),u.isIOS&&(i+="width:0px;"),n+='<div class="u-grid-content-left-bottom" id="'+this.options.id+'_content_left_bottom" style="width:'+(this.leftW+this.fixedWidth)+"px;"+i+'">',n+="</div>"),n+=this.createContentTableFixed(),n+=this.createContentTable(),n+="</div>"},createContentSumRow:function(){return""},createContentLeft:function(){var t,i=this,e="",o=0;return this.options.multiSelect&&(e+='<div class="u-grid-content-left" id="'+this.options.id+'_content_multiSelect" style="width:'+this.multiSelectWidth+"px;"+t+'">',this.dataSourceObj.rows&&$.each(this.dataSourceObj.rows,function(t){e+=i.createContentLeftMultiSelectRow(this)}),e+="</div>",o+=this.multiSelectWidth),this.options.showNumCol&&(e+='<div class="u-grid-content-left" id="'+this.options.id+'_content_numCol" style="width:'+this.numWidth+"px;left:"+o+"px;"+t+'">',this.dataSourceObj.rows&&$.each(this.dataSourceObj.rows,function(t){e+=i.createContentLeftNumColRow(t)}),e+="</div>"),e},createContentLeftMultiSelectRow:function(t,i){var e="";!this.options.autoExpand&&t.level>0&&"block"!=i&&(e="display:none;");var o=t.value["$_#_@_id"];if(o||(o=setTimeout(function(){})),gridBrowser.isIE8)var n='<div style="width:'+this.multiSelectWidth+"px;"+e+'" class="u-grid-content-multiSelect " ><span class="u-grid-checkbox-outline" id="checkbox'+o+'" value="1"><span class="u-grid-checkbox-tick-outline"></span></span></div>';else var n='<div style="width:'+this.multiSelectWidth+"px;"+e+'" class="u-grid-content-multiSelect checkbox check-success" ><span class="u-grid-checkbox-outline" id="checkbox'+o+'" value="1"><span class="u-grid-checkbox-tick-outline"></span></span></div>';return n},createContentLeftNumColRow:function(t){var i='<div style="width:'+this.numWidth+'px;" class="u-grid-content-num">'+(t+1)+"</div>";return i},createContentTable:function(t){var i,e,o,n,s,r;n=this.countContentHeight&&parseInt(this.contentHeight)>0?"height:"+this.contentHeight+"px;":"","fixed"==t?(i=parseInt(this.leftW),e="fixed_",s="fixed-",o='style="position:absolute;width:'+this.fixedWidth+"px;left:"+i+"px;"+n+'"',r='style="width:'+this.fixedWidth+'px;"'):(i=parseInt(this.leftW)+parseInt(this.fixedWidth,0),e="",s="",o='style="position:relative;left:'+i+"px;"+n,this.contentMinWidth>0&&(o+="width:"+this.contentMinWidth+"px;"),o+='"',r="",this.contentMinWidth>0&&(r=this.contentWidth>0?'style="min-width:'+this.contentMinWidth+"px;width:"+this.contentWidth+'px;"':'style="min-width:'+this.contentMinWidth+'px;"'));var d='<div id="'+this.options.id+"_content_"+e+'div" class="u-grid-content-'+s+'div" '+o+">";return d+='<div style="height:30px;position:absolute;top:-30px;width:100%;"></div><table role="grid" id="'+this.options.id+"_content_"+e+'table" '+r+">",d+=this.createColgroup(t),d+='<thead role="rowgroup" id="'+this.options.id+"_content_"+e+'thead" style="display:none">',d+=this.createThead(t),d+="</thead>",d+=this.createContentRows(t),d+="</table>","fixed"!=t&&(d+=this.createNoRowsDiv()),d+="</div>"},createContentTableFixed:function(){return""},createNoRowsDiv:function(){var t="",i="";this.contentMinWidth>0&&(t+='style="width:'+this.contentMinWidth+'px;"'),this.contentWidth>0&&(i+='style="width:'+this.contentWidth+'px;"');var e='<div class="u-grid-noRowsDiv"'+i+' id="'+this.options.id+'_noRows"></div>';return e+='<div class="u-grid-noRowsShowDiv"'+t+' id="'+this.options.id+'_noRowsShow">'+this.transMap.ml_no_rows+"</div>"},createContentRows:function(t){var i,e=this,o="";return i="fixed"==t?"fixed_":"",this.dataSourceObj.rows&&(o+='<tbody role="rowgroup" id="'+this.options.id+"_content_"+i+'tbody">',$.each(this.dataSourceObj.rows,function(i){o+=e.createContentOneRow(this,t)}),o+=this.createContentRowsSumRow(),o+="</tbody>"),o},createContentRowsSumRow:function(){return""},createContentOneRow:function(t,i,e){var o="";!this.options.autoExpand&&t.level>0&&"block"!=e&&(o='style="display:none"');var n='<tr role="row" '+o+">";return n+=this.createContentOneRowTd(t,i),n+="</tr>"},createContentOneRowForIE:function(t,i,e,o,n){var s=t.insertRow(i+1);s.setAttribute("role","row"),!this.options.autoExpand&&s.level>0&&"block"!=n&&(s.style.display="none"),this.createContentOneRowTdForIE(s,e,o)},repaintRow:function(t){var i=$("#"+this.options.id+"_content_tbody").find('tr[role="row"]')[t],e=$("#"+this.options.id+"_content_fixed_tbody").find('tr[role="row"]')[t],o=this.dataSourceObj.rows[t],n=$(i),s=this.getTrIndex(n);if(gridBrowser.isIE8||gridBrowser.isIE9){var r=$("#"+this.options.id+"_content_table")[0],d=$("#"+this.options.id+"_content_fixed_table")[0],a=i.className,l=e.className;r.deleteRow(t+1),d.deleteRow(t+1);var i=r.insertRow(t+1);u.addClass(i,a);var e=d.insertRow(t+1);u.addClass(e,l),this.createContentOneRowTdForIE(i,o),this.createContentOneRowTdForIE(e,o,"fixed")}else i.innerHTML=this.createContentOneRowTd(o),e&&(e.innerHTML=this.createContentOneRowTd(o,"fixed"));var h={};h.begin=s,h.length=1,this.renderTypeFun(h)},createContentOneRowTd:function(t,i){var e,o=this,n="",s=t.value;return e="fixed"==i?this.gridCompColumnFixedArr:this.gridCompColumnArr,$.each(e,function(){var i=this.options.field,e=$(s).attr(i);e=o.getString(e,""),"object"==$.type(e)&&(e=e.showValue);var r=(this.options.renderType,""),d="",a="",l="";if(o.options.showTree&&this.firstColumn){var h=parseInt(o.treeLeft)*parseInt(t.level);r='style="position:relative;',t.hasChild?d=o.options.autoExpand?'<span class=" uf uf-minusbutton u-grid-content-tree-span"></span>':'<span class=" uf uf-addsquarebutton2 u-grid-content-tree-span"></span>':h+=16,r+="left:"+h+'px;"'}this.options.visible||(l='style="display:none;"'),this.options.icon&&(a='<span class="'+this.options.icon+'"></span>'),n+='<td role="rowcell"  '+l+' title="'+e.replace(/\</g,"<").replace(/\>/g,">")+'"><div class="u-grid-content-td-div" '+r+">"+d+a+"<span>"+e.replace(/\</g,"&lt;").replace(/\>/g,"&gt;")+"</span></div></td>"}),n},createContentOneRowTdForIE:function(t,i,e){var o,n=this,s=i.value;o="fixed"==e?this.gridCompColumnFixedArr:this.gridCompColumnArr,$.each(o,function(){var e=this.options.field,o=$(s).attr(e),o=n.getString(o,"");"object"==$.type(o)&&(o=o.showValue);var r=(this.options.renderType,""),d="",a="",l="",h=t.insertCell();if(h.setAttribute("role","rowcell"),h.title=o.replace(/\</g,"<").replace(/\>/g,">"),n.options.showTree&&this.firstColumn){var u=parseInt(n.treeLeft)*parseInt(i.level);r='style="position:relative;',i.hasChild?d=n.options.autoExpand?'<span class=" uf uf-minusbutton u-grid-content-tree-span"></span>':'<span class=" uf uf-addsquarebutton2 u-grid-content-tree-span"></span>':u+=18,r+="left:"+u+'px;"'}this.options.visible||(h.style.display="none"),this.options.icon&&(a='<span class="'+this.options.icon+'"></span>'),l+='<div class="u-grid-content-td-div" '+r+">"+d+a+"<span>"+o.replace(/\</g,"&lt;").replace(/\>/g,"&gt;")+"</span></div>",h.insertAdjacentHTML("afterBegin",l)})},repairContent:function(){var t=$("#"+this.options.id+"_content").parent();if($("#"+this.options.id+"_content").remove(null,!0),t[0]){var i=this.createContent();t[0].insertAdjacentHTML("beforeEnd",i),this.renderTypeFun(),this.initContentDivEventFun(),$("#"+this.options.id+"_content_div")[0]&&($("#"+this.options.id+"_content_div")[0].scrollLeft=this.scrollLeft),$("#"+this.options.id+"_content_edit_menu").css("display","none")}this.realtimeTableRows=null},initEventFun:function(){var t=this;$("#"+this.options.id).on("mousedown",function(i){$(i.target).closest("#"+t.options.id+"_header").length>0?(t.mouseDownX=i.clientX,t.mouseDownY=i.clientY):$(i.target).closest("#"+t.options.id+"_content").length>0})},initGridEventFun:function(){var t=this;this.initContentDivEventFun(),$("#"+this.options.id+"_header_multi_input").on("click",function(i){this.hasChecked?(t.setAllRowUnSelect(),this.hasChecked=!1):(t.setAllRowSelect(),this.hasChecked=!0)})},initContentDivEventFun:function(){var t=this;$("#"+t.options.id+"_content .u-grid-content-left").on("click",function(i){var e=$(i.target).closest(".u-grid-checkbox-outline");if(e.length>0){var o=$(e.parent()),n=$(".u-grid-content-multiSelect",o.parent()).index(o);e.hasClass("is-checked")?t.setRowUnselect(n):t.setRowSelect(n)}}),$("#"+this.options.id+"_content_div").on("scroll",function(i){t.scrollLeft=this.scrollLeft,t.scrollTop=this.scrollTop,$("#"+t.options.id+"_header_table").css("left",t.leftW-t.scrollLeft+t.fixedWidth+"px"),$("#"+t.options.id+"_noRowsShow").css("left",t.scrollLeft+"px"),$("#"+t.options.id+"_edit_form").css("left",t.scrollLeft+"px"),$("#"+t.options.id+"_content_multiSelect").css("top",-t.scrollTop+"px"),$("#"+t.options.id+"_content_numCol").css("top",-t.scrollTop+"px"),$("#"+t.options.id+"_content_fixed_div").css("top",-t.scrollTop+"px")}),$("#"+this.options.id+"_content_tbody").on("click",function(i){"function"==typeof t.options.onDblClickFun?t.isDblEvent("tbodyClick",t.dblClickFun,i,t.clickFun,i):t.clickFun(i)}),$("#"+this.options.id+"_content_fixed_tbody").on("click",function(i){"function"==typeof t.options.onDblClickFun?t.isDblEvent("tbodyClick",t.dblClickFun,i,t.clickFun,i):t.clickFun(i)}),$("#"+this.options.id+"_content").on("mousemove",function(i){var e=$(i.target).closest("tr"),o=$(i.target).closest("div"),n=-1;e.length>0?n=$("tr",e.parent()).index(e):o.length>0&&(o.hasClass("u-grid-content-multiSelect")||o.hasClass("u-grid-content-num"))&&(n=$("div",o.parent()).index(o)),t.trHoverFun(n)}),$("#"+this.options.id+"_content").on("mouseout",function(i){if($("#"+t.options.id+"_content_tbody").find("tr").removeClass("u-grid-move-bg"),$("#"+t.options.id+"_content_fixed_tbody").find("tr").removeClass("u-grid-move-bg"),t.options.multiSelect&&$("#"+t.options.id+"_content_multiSelect").find("div").removeClass("u-grid-move-bg"),t.options.showNumCol&&$("#"+t.options.id+"_content_numCol").find("div").removeClass("u-grid-move-bg"),"function"==typeof t.options.onContentOut){var e={};e.gridObj=t;var o=$(i.target).closest("tr");if(o.length>0&&!o.is(".u-grid-content-sum-row")){var n=$('tr[role="row"]',o.parent()).index(o);e.rowObj=t.dataSourceObj.rows[n],e.rowIndex=n}t.options.onContentOut(e)}})},trHoverFun:function(t){var i=this;if($("#"+i.options.id+"_content_tbody").find("tr").removeClass("u-grid-move-bg"),$("#"+i.options.id+"_content_fixed_tbody").find("tr").removeClass("u-grid-move-bg"),i.options.multiSelect&&$("#"+i.options.id+"_content_multiSelect").find("div").removeClass("u-grid-move-bg"),i.options.showNumCol&&$("#"+i.options.id+"_content_numCol").find("div").removeClass("u-grid-move-bg"),t>-1){var e=$("#"+i.options.id+"_content_tbody").find("tr").eq(t);if(e[0].id&&e[0].id==i.options.id+"_edit_tr")return;if($("#"+i.options.id+"_content_tbody").find("tr").eq(t).addClass("u-grid-move-bg"),$("#"+i.options.id+"_content_fixed_tbody").find("tr").eq(t).addClass("u-grid-move-bg"),i.options.multiSelect&&$("#"+i.options.id+"_content_multiSelect").find("div").eq(t).addClass("u-grid-move-bg"),i.options.showNumCol&&$("#"+i.options.id+"_content_numCol").find("div").eq(t).addClass("u-grid-move-bg"),"function"==typeof i.options.onRowHover&&!e.is(".u-grid-content-sum-row")){var o={};o.gridObj=i,o.rowObj=i.dataSourceObj.rows[t],o.rowIndex=t,i.options.onRowHover(o)}}},setIntervalFun:function(t){this.widthChangeFun(),this.heightChangeFun(),this.editorRowChangeFun()},editorRowChangeFun:function(){},afterGridDivsCreate:function(){this.columnsVisibleFun(),this.resetThVariable(),this.countRowHeight(),this.noRowsShowFun(),this.renderTypeFun(),this.resetScrollLeft(),this.hideEditMenu(),"function"==typeof this.options.afterCreate&&this.options.afterCreate.call(this)},countRowHeight:function(){$("#"+this.options.id+"_content_tbody tr")[0]&&(this.rowHeight=$("#"+this.options.id+"_content_tbody tr")[0].offsetHeight)},noRowsShowFun:function(){this.dataSourceObj.rows&&this.dataSourceObj.rows.length>0?($("#"+this.options.id+"_noRowsShow").css("display","none"),$("#"+this.options.id+"_noRows").css("display","none")):($("#"+this.options.id+"_noRowsShow").css("display","block"),$("#"+this.options.id+"_noRows").css("display","block"))},updateLastRowFlag:function(){return},updateNumColLastRowFlag:function(){return},renderTypeFun:function(t){if(this.isGridShow()){if("undefined"==typeof t)var i=null,e=null,o="";else var i="undefined"==typeof t.begin?null:t.begin,e="undefined"==typeof t.length?null:t.length,o="undefined"==typeof t.field?"":t.field;var n=this,i=parseInt(i),e=parseInt(e),s=i;if(e>0&&(s=parseInt(i+e-1)),""==o)this.gridCompColumnFixedArr&&$.each(this.gridCompColumnFixedArr,function(t){n.renderTypeByColumn(this,t,i,e,!0)}),$.each(this.gridCompColumnArr,function(t){n.renderTypeByColumn(this,t,i,e,!1)});else{var r=!1;this.gridCompColumnFixedArr&&$.each(this.gridCompColumnFixedArr,function(t){if(this.options.field==o)return n.renderTypeByColumn(this,t,i,e,!0),void(r=!0)}),r||$.each(this.gridCompColumnArr,function(t){if(this.options.field==o)return void n.renderTypeByColumn(this,t,i,e,!1)})}}},renderTypeByColumn:function(t,i,e,o,n){var s=this,r=t.options.renderType,d=(t.options.sumCol,t.options.sumRenderType,t.options.dataType),a=t.options.precision,l=(t.options.format,t.options.field),h=e,c=n===!0?"_content_fixed_tbody":"_content_tbody",p=this.getVisibleIndexOfColumn(t);o>0&&(h=parseInt(e+o-1)),this.realtimeTableRows=document.getElementById(s.options.id+c).children;for(var f=-1,m=0;m<s.realtimeTableRows.length;m++)"row"!=s.realtimeTableRows[m].getAttribute("role")&&(f=m);$.each(s.dataSourceObj.rows,function(o){if(e>=0&&o>=e&&o<=h||isNaN(e)){s.editColIndex==p&&s.eidtRowIndex==o&&(s.editColIndex=-1,s.eidtRowIndex=-1);var n=o;f!=-1&&o>=f&&n++;var c=s.realtimeTableRows[n],m=c.children[i];if(m){if(m.children[0].innerHTML.indexOf("u-grid-content-tree-span")!=-1)var g=m.children[0].children[1];else var g=m.children[0];if(g){var w=$(this.value).attr(l);if("function"==typeof r||"Date"==d||"Datetime"==d||"Int"==d||"Float"==d)if(g.innerHTML="","function"==typeof r){w=s.getString(w,"");var v={};v.value=w,v.element=g,v.gridObj=s,v.row=this,v.gridCompColumn=t,v.rowIndex=o,r.call(s,v)}else if("Date"==d||"Datetime"==d)null!=w&&w!=undefined&&"null"!=w&&"undefined"!=w&&""!=w||(w=""),w="Date"==d?u.dateRender(w):u.dateTimeRender(w),g.innerHTML=w,m.title=w;else if("Int"==d)w=parseInt(w),g.innerHTML=w,m.title=w;else if("Float"==d){if(a){var C={};C.value=w,C.precision=a,w=s.DicimalFormater(C)}else w=parseFloat(w);g.innerHTML=w,m.title=w}else{w=s.getString(w,"");var _=w.replace(/\</g,"<");_=_.replace(/\>/g,">"),m.title=w,w=w.replace(/\</g,"&lt;"),w=w.replace(/\>/g,"&gt;"),g.innerHTML=w}else{w=s.getString(w,"");var _=w.replace(/\</g,"<");_=_.replace(/\>/g,">"),m.title=w,w=w.replace(/\</g,"&lt;"),w=w.replace(/\>/g,"&gt;"),g.innerHTML=w}}}}}),this.renderTypeSumRow(t,i,e,o,n)},renderTypeSumRow:function(t,i,e,o,n){},afterRepaintGrid:function(){this.resetScrollLeft(),this.hideEditMenu()},resetScrollLeft:function(){if($("#"+this.options.id+"_content_div")[0])try{$("#"+this.options.id+"_content_div")[0].scrollLeft=this.scrollLeft}catch(t){}},hideEditMenu:function(){},widthChangeFun:function(){var t=this;if($("#"+this.options.id)[0]){var i=$("#"+this.options.id).width();this.wholeWidth!=i&&(this.wholeWidth=i,i>this.options.formMaxWidth&&("form"==this.showType||""==this.showType||!$("#"+this.options.id+"_content_div tbody")[0])||this.options.overWidthHiddenColumn?t.widthChangeGridFun():i>0&&i<this.options.formMaxWidth&&("grid"==this.showType||""==this.showType),i>this.options.formMaxWidth&&(this.contentMinWidth=parseInt(this.wholeWidth)-parseInt(this.leftW)-parseInt(this.fixedWidth),this.contentMinWidth<0&&(this.contentMinWidth=0),setTimeout(function(){$("#"+t.options.id+"_header_wrap").css("max-width",t.wholeWidth+"px"),$("#"+t.options.id+"_content_div").css("width",t.contentMinWidth+"px"),$("#"+t.options.id+"_content_table").css("min-width",t.contentMinWidth+"px"),$("#"+t.options.id+"_content_table").css("width",t.contentMinWidth+"px"),$("#"+t.options.id+"_header_table").css("min-width",t.contentMinWidth+"px"),$("#"+t.options.id+"_header_table").css("width",t.contentMinWidth+"px"),$("#"+t.options.id+"_noRowsShow").css("width",t.contentMinWidth+"px"),t.columnsVisibleFun(),t.contentRealWidth<t.contentMinWidth?t.contentWidth=t.contentMinWidth:t.contentWidth=t.contentRealWidth,$("#"+t.options.id+"_noRows").css("width",t.contentWidth+"px"),"function"==typeof t.options.afterCreate&&t.options.afterCreate.call(t)},300)),$("#"+t.options.id+"_header_table").css("width",t.contentMinWidth+"px"),$("#"+t.options.id+"_edit_form").css("width",t.contentMinWidth+"px"))}},widthChangeGridFun:function(){var t=parseInt(this.wholeWidth/2);if(this.widthChangeGridFunFixed(t),this.widthChangeGridFunOverWidthHidden(),this.contentMinWidth=parseInt(this.wholeWidth)-parseInt(this.leftW)-parseInt(this.fixedWidth),this.contentMinWidth<0&&(this.contentMinWidth=0),this.contentRealWidth<this.contentMinWidth){this.contentWidth=this.contentMinWidth;var i=this.lastVisibleColumn.options.width;this.lastVisibleColumnWidth=i+(this.contentMinWidth-this.contentRealWidth),this.lastVisibleColumn.options.width=this.lastVisibleColumnWidth-20}else this.contentWidth=this.contentRealWidth;this.createGridFlag=!1,this.createGridDivs(),$("#"+this.options.id+"_form").css("display","none"),$("#"+this.options.id+"_grid").css("display","block")},widthChangeGridFunFixed:function(t){},widthChangeGridFunOverWidthHidden:function(){},heightChangeFun:function(){if(this.countContentHeight){var t=this.wholeHeight,i=$("#"+this.options.id)[0].offsetHeight;if(this.wholeHeight=i,t!=i&&i>0){var e=i-this.exceptContentHeight-1>0?i-this.exceptContentHeight-1:0;$("#"+this.options.id+"_content").css("height",e+"px"),$("#"+this.options.id+"_content_div").css("height",e+"px")}}},columnsVisibleFun:function(){var t=this,i=0;this.firstColumn=!0,$.each(this.gridCompColumnArr,function(){this.options.visible&&(i+=parseInt(this.options.width),this.firstColumn=t.firstColumn,t.firstColumn=!1,t.lastVisibleColumn=this,t.lastVisibleColumnWidth=this.options.width)}),this.contentRealWidth=i},resetThVariable:function(){if("grid"==this.showType){var t=this;this.contentWidth=0,$("#"+this.options.id+"_header_table th",this.$ele).each(function(i){var e=t.gridCompColumnArr[i],o=0;e.options.visible&&(o=e.options.width),this.attrLeftTotalWidth=t.contentWidth,t.contentWidth+=o,t.resetThVariableDrag(this,e,o),this.gridCompColumn=e,this.attrWidth=o,this.attrRightTotalWidth=t.contentWidth}),t.resetThVariableHeaderLevel()}},resetThVariableDrag:function(t,i){},resetThVariableHeaderLevel:function(){},contentWidthChange:function(t){if(t<this.contentMinWidth){var i=this.lastVisibleColumn.options.width;this.lastVisibleColumnWidth=i+(this.contentMinWidth-t),$("#"+this.options.id+"_header_table col:last").css("width",this.lastVisibleColumnWidth+"px"),$("#"+this.options.id+"_content_table col:last").css("width",this.lastVisibleColumnWidth+"px"),t=this.contentMinWidth}return $("#"+this.options.id+"_content_table").css("width",t+"px"),$("#"+this.options.id+"_noRows").css("width",t+"px"),t>this.contentMinWidth?($("#"+this.options.id+"_content_left_bottom").css("display","block"),$("#"+this.options.id+"_content_left_sum_bottom").css("bottom",16)):($("#"+this.options.id+"_content_left_bottom").css("display","none"),$("#"+this.options.id+"_content_left_sum_bottom").css("bottom",0)),t},getColumnAttr:function(t,i){for(var e=0;e<this.gridCompColumnArr.length;e++)if(this.gridCompColumnArr[e].options.field==i)return $(this.gridCompColumnArr[e].options).attr(t);return""},getColumnByField:function(t){for(var i=0;i<this.gridCompColumnArr.length;i++)if(this.gridCompColumnArr[i].options.field==t)return this.gridCompColumnArr[i];return null},getIndexOfColumn:function(t){for(var i=-1,e=0;e<this.gridCompColumnArr.length;e++)if(this.gridCompColumnArr[e]==t){i=e;break}return i},getVisibleIndexOfColumn:function(t){for(var i=-1,e=0,o=0;o<this.gridCompColumnArr.length;o++){if(this.gridCompColumnArr[o]==t){"none"!=$("#"+this.options.id+"_header").find("th").eq(o).css("display")&&(i=e);break}"none"!=$("#"+this.options.id+"_header").find("th").eq(o).css("display")&&e++}return i},getNextVisibleInidexOfColumn:function(t){for(var i=-1,e=!1,o=0,n=0;n<this.gridCompColumnArr.length;n++)if(this.gridCompColumnArr[n]!=t){if(1==e&&"none"!=$("#"+this.options.id+"_header").find("th").eq(n).css("display")){i=o;break}"none"!=$("#"+this.options.id+"_header").find("th").eq(n).css("display")&&o++}else e=!0;return i},headerFirstClassFun:function(){$("#"+this.options.id+"_grid .u-grid-header-th-first").removeClass("u-grid-header-th-first"),$("#"+this.options.id+"_grid").find("th").eq(0).addClass("u-grid-header-th-first")},isDblEvent:function(t,i,e,o,n){if(null!=this.currentEventName&&this.currentEventName==t)i.call(this,e),this.currentEventName=null,this.cleanCurrEventName&&clearTimeout(this.cleanCurrEventName);else{var s=this;this.cleanCurrEventName&&clearTimeout(this.cleanCurrEventName),this.currentEventName=t,this.cleanCurrEventName=setTimeout(function(){s.currentEventName=null,o.call(s,n)},250)}},dblClickFun:function(t){if("function"==typeof this.options.onDblClickFun){var i=$(t.target).closest("tr");if(i[0].id==this.options.id+"_edit_tr")return;var e=0;i.length>0&&(e=this.getTrIndex(i));var o={};o.gridObj=this,o.rowObj=this.dataSourceObj.rows[e],o.rowIndex=e,this.options.onDblClickFun(o)}},clickFun:function(t){var i=this,e=$(t.target).closest("tr");if(!(e.length>0&&e[0].id==this.options.id+"_edit_tr")){var o=this.getTrIndex(e);if("function"==typeof this.options.onBeforeClickFun){var n={};if(n.gridObj=this,n.rowObj=this.dataSourceObj.rows[o],n.rowIndex=o,n.e=t,!this.options.onBeforeClickFun(n))return}if(this.clickFunTree(t),e.length>0){var s=i.dataSourceObj.rows[o];if(s){if(i.options.rowClickBan)return;
  s.childRowIndex;i.dataSourceObj.rows[o].focus&&i.options.cancelFocus?i.setRowUnFocus(o):i.dataSourceObj.rows[o].focus||i.setRowFocus(o),this.clickFunEdit(t,o)}}}},clickFunTree:function(t){},clickFunEdit:function(t){},setColumnVisibleByColumn:function(t,i){var e=this.getIndexOfColumn(t);this.setColumnVisibleByIndex(e,i)},setColumnVisibleByIndex:function(t,i){if(t>=0){var e=this.gridCompColumnArr[t],o=this.getVisibleIndexOfColumn(e);if(0==e.options.visible&&i){var n="<col";e.options.width&&(n+=' style="width:'+this.formatWidth(e.options.width)+'"'),n+=">",$("#"+this.options.id+"_header th:eq("+t+")").css("display",""),$("#"+this.options.id+"_content th:eq("+t+")").css("display",""),$("td:eq("+t+")",$("#"+this.options.id+"_content tbody tr")).css("display","");var s=this.getNextVisibleInidexOfColumn(e);if(s==-1)try{$("#"+this.options.id+"_header col:last")[0].insertAdjacentHTML("afterEnd",n),$("#"+this.options.id+"_content col:last")[0].insertAdjacentHTML("afterEnd",n)}catch(r){$("#"+this.options.id+"_header col:last").after(n),$("#"+this.options.id+"_content col:last").after(n)}else try{$("#"+this.options.id+"_header col:eq("+s+")")[0].insertAdjacentHTML("beforeBegin",n),$("#"+this.options.id+"_content col:eq("+s+")")[0].insertAdjacentHTML("beforeBegin",n)}catch(r){$("#"+this.options.id+"_header col:eq("+s+")").before(n),$("#"+this.options.id+"_content col:eq("+s+")").before(n)}var d=this.contentWidth+e.options.width}if(1==e.options.visible&&!i){$("#"+this.options.id+"_header th:eq("+t+")").css("display","none"),$("#"+this.options.id+"_header col:eq("+o+")").remove(),$("#"+this.options.id+"_content th:eq("+t+")").css("display","none"),$("#"+this.options.id+"_content col:eq("+o+")").remove(),$("td:eq("+t+")",$("#"+this.options.id+"_content tbody tr")).css("display","none");var d=this.contentWidth-e.options.width}e.options.visible=i,this.columnsVisibleFun();var a=this.contentWidthChange(d);this.lastVisibleColumn.options.width=this.lastVisibleColumnWidth,this.contentWidth=a,this.resetThVariable(),this.saveGridCompColumnArrToLocal()}},formatWidth:function(t){return t?(t+"").indexOf("%")>0?t:parseInt(t)+"px":""},swapEle:function(t,i){var e=t.next(),o=i.prev();i.insertBefore(e),t.insertAfter(o)},getString:function(t,i){return null!==t&&t!==undefined&&"null"!==t&&"undefined"!==t&&""!==t||(t=i),gridBrowser.isIE8?[t].join(""):t+""},getInt:function(t,i){return(null===t||t===undefined||"null"===t||"undefined"===t||""===t||isNaN(t))&&(t=i),t},getFloat:function(t,i){return(null===t||t===undefined||"null"===t||"undefined"===t||""===t||isNaN(t))&&(t=i),t},cloneObj:function(t){var i;if("object"==typeof t)if(null===t)i=null;else if(t instanceof Array){i=[];for(var e=0,o=t.length;e<o;e++)i.push(this.cloneObj(t[e]))}else{i={};for(var n in t)i[n]=this.cloneObj(t[n])}else i=t;return i},DicimalFormater:function(t){for(var i=t.value+"",e=t.precision,o=0;o<i.length;o++)if("-0123456789.".indexOf(i.charAt(o))==-1)return"";return this.checkDicimalInvalid(i,e)},checkDicimalInvalid:function(t,i){if(null==t||isNaN(t))return"";var e=parseFloat(t),o=(e*Math.pow(10,i)/Math.pow(10,i)).toFixed(i);return"NaN"==o?"":o},accAdd:function(t,i){var e,o,n;try{e=t.toString().split(".")[1].length}catch(s){e=0}try{o=i.toString().split(".")[1].length}catch(s){o=0}return n=Math.pow(10,Math.max(e,o)),(t*n+i*n)/n},getTrIndex:function(t){return $('tr[id!="'+this.options.id+'_edit_tr"]',t.parent()).index(t)},setDataSource:function(t){this.initDataSourceVariable(),this.options.dataSource=t,this.initDataSource(),this.repairContent(),this.afterGridDivsCreate()},setDataSourceFun1:function(t){var i={};if(t.values){var e=new Array;$.each(t.values,function(){if(t.fields){var i={},o=this;$.each(t.fields,function(t){$(i).attr(this,o[t])}),e.push(i)}})}$(i).attr("values",e),this.setDataSource(i)},addOneRow:function(t,i){var e="none",o={},n=this.dataSourceObj.rows.length,s=!1;if(o.value=t,"grid"==this.showType){this.editClose(),i=this.addOneRowTree(t,i,o),0!=i&&(i&&i>0?n<i&&(i=n):i=0),n==i&&(s=!0),o.valueIndex=i,o.value=t,this.dataSourceObj.rows.splice(i,0,o),this.updateEditRowIndex("+",i),this.dataSourceObj.rows.length>i+1&&$.each(this.dataSourceObj.rows,function(t){t>i&&(this.valueIndex=this.valueIndex+1)});try{var r=this.createContentOneRow(o,"normal",e);if(s)$("#"+this.options.id+"_content_tbody")[0].insertAdjacentHTML("beforeEnd",r);else{var d=$("#"+this.options.id+"_content_tbody").find('tr[role="row"]')[i],a=$("#"+this.options.id+"_content_tbody")[0];d?d.insertAdjacentHTML("beforeBegin",r):a&&a.insertAdjacentHTML("afterBegin",r)}if($("#"+this.options.id+"_content_fixed_div").length>0){var r=this.createContentOneRow(o,"fixed",e);if(s)$("#"+this.options.id+"_content_fixed_tbody")[0].insertAdjacentHTML("beforeEnd",r);else{var d=$("#"+this.options.id+"_content_fixed_tbody").find('tr[role="row"]')[i];d?d.insertAdjacentHTML("beforeBegin",r):$("#"+this.options.id+"_content_fixed_tbody")[0]&&$("#"+this.options.id+"_content_fixed_tbody")[0].insertAdjacentHTML("afterBegin",r)}}}catch(l){var h=$("#"+this.options.id+"_content_div table")[0];h&&this.createContentOneRowForIE(h,i,o,"normal",e);var u=$("#"+this.options.id+"_content_fixed_div table")[0];u&&this.createContentOneRowForIE(u,i,o,"fixed",e)}if(this.options.multiSelect){var r=this.createContentLeftMultiSelectRow(o,e);if(s)$("#"+this.options.id+"_content_multiSelect")[0].insertAdjacentHTML("beforeEnd",r);else{var c=$("#"+this.options.id+"_content_multiSelect").find("div")[i];c?c.insertAdjacentHTML("beforeBegin",r):$("#"+this.options.id+"_content_multiSelect")[0].insertAdjacentHTML("afterBegin",r)}}if(this.options.showNumCol){var r=this.createContentLeftNumColRow(n);if(s)$("#"+this.options.id+"_content_numCol")[0].insertAdjacentHTML("beforeEnd",r);else{var c=$("#"+this.options.id+"_content_numCol").find("div")[i];c?c.insertAdjacentHTML("beforeBegin",r):$("#"+this.options.id+"_content_numCol")[0].insertAdjacentHTML("afterBegin",r)}this.resetNumCol(),this.updateNumColLastRowFlag()}this.repairSumRow(),this.noRowsShowFun(),this.updateLastRowFlag();var p={};p.begin=i,p.length=1,this.renderTypeFun(p)}var n=0;this.options.showTree?(this.dataSourceObj.options.values?n=this.dataSourceObj.options.values.length:this.dataSourceObj.options.values=new Array,this.dataSourceObj.options.values.splice(i,0,t),this.addOneRowTreeHasChildF(o)):(this.dataSourceObj.options.values||(this.dataSourceObj.options.values=new Array),this.dataSourceObj.options.values.splice(i,0,t))},addOneRowTree:function(t,i){return i},addOneRowTreeHasChildF:function(){},editClose:function(){},addRows:function(t,i){if(this.options.showTree)for(var e=t.length,o=0;o<e;o++)this.addOneRow(t[o],e);else{this.editClose();var n="",s="",r="",d="",a=this,e=this.dataSourceObj.rows.length,l=!1;0!=i&&(i&&i>0?e<i&&(i=e):i=0),e==i&&(l=!0);var h=new Array;if($.each(t,function(t){var e={};e.value=this,e.valueIndex=i+t,h.push(e),a.dataSourceObj.rows.splice(i+t,0,e),a.updateEditRowIndex("+",i+t)}),this.dataSourceObj.rows.length>i+t.length&&$.each(this.dataSourceObj.rows,function(e){e>i+t.length-1&&(this.valueIndex=this.valueIndex+t.length)}),"grid"==this.showType&&$("#"+this.options.id+"_content_div tbody")[0]){$.each(h,function(t){n+=a.createContentOneRow(this),d+=a.createContentOneRowFixed(this),a.options.multiSelect&&(s+=a.createContentLeftMultiSelectRow(this)),a.options.showNumCol&&(r+=a.createContentLeftNumColRow(e+t))});try{l?$("#"+this.options.id+"_content_div tbody")[0].insertAdjacentHTML("beforeEnd",n):$("#"+this.options.id+"_content_div").find("tbody").find('tr[role="row"]')[i]?$("#"+this.options.id+"_content_div").find("tbody").find('tr[role="row"]')[i].insertAdjacentHTML("beforeBegin",n):$("#"+this.options.id+"_content_div tbody")[0]&&$("#"+this.options.id+"_content_div tbody")[0].insertAdjacentHTML("afterBegin",n),l?$("#"+this.options.id+"_content_fixed_div tbody")[0].insertAdjacentHTML("beforeEnd",d):$("#"+this.options.id+"_content_fixed_div").find("tbody").find('tr[role="row"]')[i]?$("#"+this.options.id+"_content_fixed_div").find("tbody").find('tr[role="row"]')[i].insertAdjacentHTML("beforeBegin",d):$("#"+this.options.id+"_content_fixed_div tbody")[0]&&$("#"+this.options.id+"_content_fixed_div tbody")[0].insertAdjacentHTML("afterBegin",d)}catch(u){var c=$("#"+this.options.id+"_content_div table")[0],p=$("#"+this.options.id+"_content_fixed_div table")[0];c&&p&&$.each(h,function(t){a.createContentOneRowForIE(c,i+t,this),a.createContentOneRowForIE(p,i+t,this,"fixed")})}if(this.options.multiSelect)if(l)$("#"+this.options.id+"_content_multiSelect")[0].insertAdjacentHTML("beforeEnd",s);else{var f=$("#"+this.options.id+"_content_multiSelect").find("div")[i];f?f.insertAdjacentHTML("beforeBegin",s):$("#"+this.options.id+"_content_multiSelect")[0].insertAdjacentHTML("afterBegin",s)}if(this.options.showNumCol){if(l)$("#"+this.options.id+"_content_numCol")[0].insertAdjacentHTML("beforeEnd",r);else{var f=$("#"+this.options.id+"_content_numCol").find("div")[i];f?f.insertAdjacentHTML("beforeBegin",r):$("#"+this.options.id+"_content_numCol")[0].insertAdjacentHTML("afterBegin",r)}this.resetNumCol(),this.updateNumColLastRowFlag()}this.repairSumRow(),this.noRowsShowFun();var m={};m.begin=i,m.length=t.length,this.renderTypeFun(m)}this.dataSourceObj.options.values||(this.dataSourceObj.options.values=new Array),$.each(t,function(t){a.dataSourceObj.options.values.splice(i+t,0,this)}),this.updateLastRowFlag()}},createContentOneRowFixed:function(t){return""},updateEditRowIndex:function(t,i,e){},deleteOneRow:function(t){var i=this;t=parseInt(t);var e=this.dataSourceObj.rows[t];if(e){var o=e.value;if("grid"==this.showType&&this.editClose(),this.dataSourceObj.rows.splice(t,1),this.updateEditRowIndex("-",t),this.selectRows&&$.each(this.selectRows,function(e){this==o?(i.selectRows.splice(e,1),i.selectRowsObj.splice(e,1),i.selectRowsIndex.splice(e,1)):i.selectRowsIndex[e]>t&&(i.selectRowsIndex[e]=i.selectRowsIndex[e]-1)}),this.focusRow&&(this.focusRow==o?(this.focusRow=null,this.focusRowObj=null,this.focusRowIndex=null):this.focusRowIndex>t&&(this.focusRowIndex=this.focusRowIndex-1)),"grid"==this.showType&&($("#"+this.options.id+"_content_div tbody tr:eq("+t+")").remove(),$("#"+this.options.id+"_content_fixed_div tbody tr:eq("+t+")").remove(),$("#"+this.options.id+"_content_multiSelect >div:eq("+t+")").remove(),$("#"+this.options.id+"_content_numCol >.u-grid-content-num:eq("+t+")").remove(),this.resetNumCol(),this.repairSumRow(),this.noRowsShowFun(),this.updateNumColLastRowFlag()),this.dataSourceObj.options.values){var n=this.dataSourceObj.options.values.indexOf(o);this.dataSourceObj.options.values.splice(n,1)}if(this.deleteOneRowTree(),"function"==typeof this.options.onRowDelete){var s={};if(s.gridObj=this,s.index=t,!this.options.onRowDelete(t))return}}},repairSumRow:function(){},deleteOneRowTree:function(){},deleteRows:function(t){var i=this,e=new Array;$.each(t,function(i){e.push(t[i])}),e.sort(function(t,i){return i-t}),$.each(e,function(t){i.deleteOneRow(this)})},updateRow:function(t,i){if(this.dataSourceObj.rows[t].value=i,this.dataSourceObj.options.values[this.dataSourceObj.rows[t].valueIndex]=i,"grid"==this.showType){var e={};e.begin=t,e.length=1,this.renderTypeFun(e),this.repairSumRow()}},updateValueAt:function(t,i,e,o){var n=$(this.dataSourceObj.rows[t].value).attr(i),s=t;if(n!=e||o){if($(this.dataSourceObj.rows[t].value).attr(i,e),$(this.dataSourceObj.options.values[this.dataSourceObj.rows[t].valueIndex]).attr(i,e),"grid"==this.showType){var r={};r.field=i,r.begin=t,r.length=1,this.renderTypeFun(r),s=this.updateValueAtTree(t,i,e,o),this.updateValueAtEdit(t,i,e,o),this.repairSumRow()}if("function"==typeof this.options.onValueChange){var r={};r.gridObj=this,r.rowIndex=s,r.field=i,r.oldValue=n,r.newValue=e,this.options.onValueChange(r)}}},updateValueAtTree:function(t,i,e,o){return t},updateValueAtEdit:function(t,i,e,o){},setRowSelect:function(t,i){var e,o,n,s;if(!this.dataSourceObj.rows[t])return!0;if(this.dataSourceObj.rows[t].checked)return!0;if(e=i&&i.multiSelectDivs?i.multiSelectDivs[t]:this.$ele.find("#"+this.options.id+"_content_multiSelect").children()[t],"function"==typeof this.options.onBeforeRowSelected){var r={};if(r.gridObj=this,r.rowObj=this.dataSourceObj.rows[t],r.rowIndex=t,!this.options.onBeforeRowSelected(r)){if(this.options.multiSelect){var d=e.children[0];d.checked=!1}return!1}}if(this.options.multiSelect){if("grid"==this.showType){var d=e.children[0];$(d).addClass("is-checked")}}else this.selectRowsObj&&this.selectRowsObj.length>0&&$.each(this.selectRowsObj,function(){this.checked=!1}),this.selectRows=new Array,this.selectRowsObj=new Array,this.selectRowsIndex=new Array,"grid"==this.showType&&($("#"+this.options.id+"_content_tbody tr").removeClass("u-grid-content-sel-row"),$("#"+this.options.id+"_content_tbody tr a").removeClass("u-grid-content-sel-row"),$("#"+this.options.id+"_content_fixed_tbody tr").removeClass("u-grid-content-sel-row"),$("#"+this.options.id+"_content_fixed_tbody tr a").removeClass("u-grid-content-sel-row"),this.options.multiSelect&&$("#"+this.options.id+"_content_multiSelect div").removeClass("u-grid-content-sel-row"),this.options.showNumCol&&$("#"+this.options.id+"_content_numCol div").removeClass("u-grid-content-sel-row"));if("grid"==this.showType){o=i&&i.contentTrs?i.contentTrs[t]:this.$ele.find("#"+this.options.id+'_content_tbody tr[role="row"]')[t],$(o).addClass("u-grid-content-sel-row"),n=i&&i.fixContentTrs?i.fixContentTrs[t]:this.$ele.find("#"+this.options.id+'_content_fixed_tbody tr[role="row"]')[t],$(n).addClass("u-grid-content-sel-row");var a=t;this.eidtRowIndex>-1&&this.eidtRowIndex<t&&"form"==this.options.editType&&a++,this.options.multiSelect&&(a!=t&&(e=this.$ele.find("#"+this.options.id+"_content_multiSelect").children()[a]),$(e).addClass("u-grid-content-sel-row")),this.options.showNumCol&&(s=i&&i.numColDivs?i.numColDivs[a]:this.$ele.find("#"+this.options.id+"_content_numCol").children()[a],$(s).addClass("u-grid-content-sel-row"))}if(this.selectRows.push(this.dataSourceObj.rows[t].value),this.selectRowsObj.push(this.dataSourceObj.rows[t]),this.selectRowsIndex.push(t),this.dataSourceObj.rows[t].checked=!0,"function"==typeof this.options.onRowSelected){var r={};r.gridObj=this,r.rowObj=this.dataSourceObj.rows[t],r.rowIndex=t,this.options.onRowSelected(r)}return!0},setRowUnselect:function(t){var i=this;if(!this.dataSourceObj.rows[t])return!0;if(!this.dataSourceObj.rows[t].checked)return!0;if("function"==typeof this.options.onBeforeRowUnSelected){var e={};if(e.gridObj=this,e.rowObj=this.dataSourceObj.rows[t],e.rowIndex=t,!this.options.onBeforeRowUnSelected(e))return this.options.multiSelect&&($("#"+this.options.id+"_content_multiSelect input:eq("+t+")")[0].checked=!0),!1}this.options.multiSelect&&$("#"+this.options.id+"_content_multiSelect .u-grid-checkbox-outline:eq("+t+")").removeClass("is-checked");var o=t;if(this.eidtRowIndex>-1&&this.eidtRowIndex<t&&"form"==this.options.editType&&o++,$("#"+this.options.id+"_content_tbody tr:eq("+o+")").removeClass("u-grid-content-sel-row"),$("#"+this.options.id+"_content_tbody tr:eq("+o+") a").removeClass("u-grid-content-sel-row"),$("#"+this.options.id+"_content_fixed_tbody tr:eq("+o+")").removeClass("u-grid-content-sel-row"),$("#"+this.options.id+"_content_fixed_tbody tr:eq("+o+") a").removeClass("u-grid-content-sel-row"),this.options.multiSelect&&$("#"+this.options.id+"_content_multiSelect >div:eq("+o+")").removeClass("u-grid-content-sel-row"),this.options.showNumCol&&$("#"+this.options.id+"_content_numCol >div:eq("+o+")").removeClass("u-grid-content-sel-row"),$.each(this.selectRows,function(e){this==i.dataSourceObj.rows[t].value&&(i.selectRows.splice(e,1),i.selectRowsObj.splice(e,1),i.selectRowsIndex.splice(e,1))}),this.dataSourceObj.rows[t].checked=!1,"function"==typeof this.options.onRowUnSelected){var e={};e.gridObj=this,e.rowObj=this.dataSourceObj.rows[t],e.rowIndex=t,this.options.onRowUnSelected(e)}return!0},setAllRowSelect:function(){if($("#"+this.options.id+"_header_multi_input").addClass("is-checked"),"function"==typeof this.options.onBeforeAllRowSelected){var t={};if(t.gridObj=this,t.rowObjs=this.dataSourceObj.rows,!this.options.onBeforeAllRowSelected(t))return}var i=this.$ele.find("#"+this.options.id+"_content_multiSelect").children(),e=this.$ele.find("#"+this.options.id+"_content_numCol").children(),o=this.$ele.find("#"+this.options.id+'_content_tbody tr[role="row"]'),n=this.$ele.find("#"+this.options.id+'_content_fixed_tbody tr[role="row"]');this.$ele.find("#"+this.options.id+'_content_tbody tr[role="row"]');for(var s=0;s<this.dataSourceObj.rows.length;s++)this.setRowSelect(s,{multiSelectDivs:i,numColDivs:e,contentTrs:o,fixContentTrs:n});if("function"==typeof this.options.onAllRowSelected){var t={};t.gridObj=this,t.rowObjs=this.dataSourceObj.rows,this.options.onAllRowSelected(t)}},setAllRowUnSelect:function(){if($("#"+this.options.id+"_header_multi_input").removeClass("is-checked"),"function"==typeof this.options.onBeforeAllRowUnSelected){var t={};if(t.gridObj=this,t.rowObjs=this.dataSourceObj.rows,!this.options.onBeforeAllRowUnSelected(t))return}for(var i=0;i<this.dataSourceObj.rows.length;i++)this.setRowUnselect(i);if("function"==typeof this.options.onAllRowUnSelected){var t={};t.gridObj=this,t.rowObjs=this.dataSourceObj.rows,this.options.onAllRowUnSelected(t)}},getSelectRows:function(){return this.selectRows},getSelectRowsIndex:function(){return this.selectRowsIndex},setRowFocus:function(t){if(this.dataSourceObj.rows[t].focus)return!0;if(!this.dataSourceObj.rows[t])return!0;if("function"==typeof this.options.onBeforeRowFocus){var i={};if(i.gridObj=this,i.rowObj=this.dataSourceObj.rows[t],i.rowIndex=t,!this.options.onBeforeRowFocus(i))return!1}$("#"+this.options.id+"_content_tbody tr").removeClass("u-grid-content-focus-row"),$("#"+this.options.id+"_content_tbody tr a").removeClass("u-grid-content-focus-row"),$("#"+this.options.id+"_content_fixed_tbody tr").removeClass("u-grid-content-focus-row"),$("#"+this.options.id+"_content_fixed_tbody tr a").removeClass("u-grid-content-focus-row"),this.options.multiSelect&&$("#"+this.options.id+"_content_multiSelect").find("div").removeClass("u-grid-content-focus-row"),this.options.showNumCol&&$("#"+this.options.id+"_content_numCol").find("div").removeClass("u-grid-content-focus-row"),this.focusRowObj&&(this.focusRowObj.focus=!1),$("#"+this.options.id+'_content_tbody tr[role="row"]:eq('+t+")").addClass("u-grid-content-focus-row"),$("#"+this.options.id+'_content_tbody tr[role="row"]:eq('+t+") a").addClass("u-grid-content-focus-row"),$("#"+this.options.id+'_content_fixed_tbody tr[role="row"]:eq('+t+")").addClass("u-grid-content-focus-row"),$("#"+this.options.id+'_content_fixed_tbody tr[role="row"]:eq('+t+") a").addClass("u-grid-content-focus-row");var e=t;if(this.eidtRowIndex>-1&&this.eidtRowIndex<t&&"form"==this.options.editType&&e++,this.options.multiSelect&&$("#"+this.options.id+"_content_multiSelect >div:eq("+e+")").addClass("u-grid-content-focus-row"),this.options.showNumCol&&$("#"+this.options.id+"_content_numCol >div:eq("+e+")").addClass("u-grid-content-focus-row"),this.focusRow=this.dataSourceObj.rows[t].value,this.focusRowObj=this.dataSourceObj.rows[t],this.focusRowIndex=t,this.dataSourceObj.rows[t].focus=!0,"function"==typeof this.options.onRowFocus){var i={};i.gridObj=this,i.rowObj=this.dataSourceObj.rows[t],i.rowIndex=t,this.options.onRowFocus(i)}return this.options.multiSelect||this.setRowSelect(t),!0},setRowUnFocus:function(t){if(!this.dataSourceObj.rows[t])return!0;if("function"==typeof this.options.onBeforeRowUnFocus){var i={};if(i.gridObj=this,i.rowObj=this.dataSourceObj.rows[t],i.rowIndex=t,!this.options.onBeforeRowUnFocus(i))return!1}if(!this.dataSourceObj.rows[t].focus)return!0;var e=t;if(this.eidtRowIndex>-1&&this.eidtRowIndex<t&&"form"==this.options.editType&&e++,$("#"+this.options.id+"_content_tbody tr:eq("+e+")").removeClass("u-grid-content-focus-row"),$("#"+this.options.id+"_content_tbody tr:eq("+e+") a").removeClass("u-grid-content-focus-row"),$("#"+this.options.id+"_content_fixed_tbody tr:eq("+e+")").removeClass("u-grid-content-focus-row"),$("#"+this.options.id+"_content_fixed_tbody tr:eq("+e+") a").removeClass("u-grid-content-focus-row"),this.options.multiSelect&&$("#"+this.options.id+"_content_multiSelect >div:eq("+e+")").removeClass("u-grid-content-focus-row"),this.options.showNumCol&&$("#"+this.options.id+"_content_numCol >div:eq("+e+")").removeClass("u-grid-content-focus-row"),this.dataSourceObj.rows[t].focus=!1,this.focusRow=null,this.focusRowObj=null,this.focusRowIndex=null,"function"==typeof this.options.onRowUnFocus){var i={};i.gridObj=this,i.rowObj=this.dataSourceObj.rows[t],i.rowIndex=t,this.options.onRowUnFocus(i)}return this.options.multiSelect||this.setRowUnselect(t),!0},resetNumCol:function(){var t=$("#"+this.options.id+"_content_numCol >.u-grid-content-num");$.each(t,function(t){this.innerHTML=t+1+""})},getFocusRow:function(){return this.focusRow},getFocusRowIndex:function(){return this.focusRowIndex},getAllRows:function(){var t=this;return this.allRows=new Array,this.dataSourceObj.rows&&$.each(this.dataSourceObj.rows,function(){t.allRows.push(this.value)}),this.allRows},getRowByIndex:function(t){return this.dataSourceObj.rows[t]},getRowIndexByValue:function(t,i){var e=-1;return $.each(this.dataSourceObj.rows,function(o){var n=$(this.value).attr(t);n==i&&(e=o)}),e},setRenderType:function(t,i){var e=this.getColumnByField(t);e.options.renderType=i;var o=this.getIndexOfColumn(e);this.renderTypeByColumn(e,o)},setShowHeader:function(t){this.options.showHeader=t,t?$("#"+this.options.id+"_header").css("display","block"):$("#"+this.options.id+"_header").css("display","none")},setColumnPrecision:function(t,i){var e=this.getColumnByField(t);e.options.precision=i,this.renderTypeFun(),this.options.showSumRow&&this.repairSumRow()},setMultiSelect:function(t){var i=this.options.multiSelect;i!=t&&(this.options.multiSelect=t,this.initGrid())},setShowNumCol:function(t){var i=this.options.showNumCol;i!=t&&(this.options.showNumCol=t,this.initGrid())},isGridShow:function(){return"grid"==this.showType},getBoolean:function(t){return"true"===t||t===!0}},gridCompColumn.prototype={init:function(options,gridComp){this.gridComp=gridComp;var gridOptions=gridComp.options;this.defaults={width:200,sortable:!0,canDrag:!0,fixed:!1,visible:!0,canVisible:!0,sumCol:!1,editable:!0,editFormShow:!0,autoExpand:!1,editType:"text",dataType:"String",format:"YYYY-MM-DD hh:mm:ss",headerLevel:1,hiddenLevel:1};var gridDefault={sortable:gridOptions.sortable,canDrag:gridOptions.canDrag,width:gridOptions.columnWidth};"Date"==options.dataType&&(this.defaults.format="YYYY-MM-DD"),options=this.initTree(options,gridOptions),this.options=$.extend({},this.defaults,gridDefault,options),this.getBooleanOptions();try{"string"==typeof this.options.renderType&&(this.options.renderType=eval(this.options.renderType))}catch(e){}try{"string"==typeof this.options.editType&&(this.options.editType=eval(this.options.editType))}catch(e){}this.options.width=parseInt(this.options.width),this.firstColumn=!1},initTree:function(t){return t},getBooleanOptions:function(){this.options.sortable=this.gridComp.getBoolean(this.options.sortable),this.options.canDrag=this.gridComp.getBoolean(this.options.canDrag),this.options.fixed=this.gridComp.getBoolean(this.options.fixed),this.options.visible=this.gridComp.getBoolean(this.options.visible),this.options.canVisible=this.gridComp.getBoolean(this.options.canVisible),this.options.sumCol=this.gridComp.getBoolean(this.options.sumCol),this.options.editable=this.gridComp.getBoolean(this.options.editable),this.options.editFormShow=this.gridComp.getBoolean(this.options.editFormShow),this.options.autoExpand=this.gridComp.getBoolean(this.options.autoExpand)}},dataSource.prototype={init:function(t,i){this.defaults={},this.gridComp=i,this.options=$.extend({},this.defaults,t),this.rows=new Array,this.hasParentRows=new Array,this.nothasParentRows=new Array},sortRows:function(t,i){this.gridComp.options.showTree?this.treeSortRows(t,i):this.basicSortRows(t,i),this.gridComp.eidtRowIndex=-1},basicSortRows:function(t,i){var e=this,o="";t&&(o=this.gridComp.getColumnByField(t).options.dataType),this.rows=new Array,this.options.values&&$.each(this.options.values,function(t){var i={};i.value=this,i.valueIndex=t,e.rows.push(i)})},treeSortRows:function(t,i){this.basicSortRows(t,i)},getSumValue:function(t,i,e){var o=null;if(i.options.sumCol&&$.each(this.rows,function(n){var s=$(this.value).attr(t);"Int"==i.options.dataType?(s=e.getInt(s,0),o+=parseInt(s)):(s=e.getFloat(s,0),o=e.accAdd(o,parseFloat(s)))}),"Float"==i.options.dataType&&i.options.precision){var n={};n.value=o,n.precision=i.options.precision,o=e.DicimalFormater(n)}return null!=o&&o!=undefined&&"null"!=o&&"undefined"!=o?o+"":""}};var old=$.fn.grid;$.fn.grid=function(t){var i=$(this).data("gridComp");return i||$(this).data("gridComp",i=new gridComp(this,t)),i},$.fn.grid.gridComp=gridComp,$.fn.grid.gridCompColumn=gridCompColumn,$.fn.grid.dataSource=dataSource,$.fn.grid.noConflict=function(){return $.fn.grid=old,this}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype,r=s.initGridCompColumn,d=s.initEventFun,a=s.initGridEventFun;s.initGridCompColumnColumnMenuFun=function(t){var i=new this.gridCompColumn(t,this);i.options.realWidth=i.options.width,this.basicGridCompColumnArr.push(i)},s.initGridCompColumn=function(){r.apply(this,arguments),this.menuColumnsHeight=this.gridCompColumnArr.length*this.columnMenuHeight},s.createColumnMenu=function(){var i=this,e='<div class="u-grid-column-menu" id="'+this.options.id+'_column_menu">';return e+='<ul data-role="menu" role="menubar" class="u-grid-column-menu-ul" id="'+this.options.id+'_column_menu_ul">',e+='<li class="u-grid-column-menu-li" role="menuitem">',e+='<div class="u-grid-column-menu-div1" id="'+this.options.id+'_clearSet">',e+='<span class="u-grid-column-menu-span">'+this.transMap.ml_clear_set+"</span>",e+="</div></li>",e+='<div class="u-grid-column-menu-columns" id="'+this.options.id+'_column_menu_columns">',e+='<ul data-role="menu" role="menubar" class="u-grid-column-menu-columns-ul" id="'+this.options.id+'_column_menu_columns_ul">',t.each(this.gridCompColumnArr,function(t){if(""!=i.getString(this.options.title,"")){e+='<li class="u-grid-column-menu-columns-li" role="menuitem" index="'+t+'">',e+='<div class="u-grid-column-menu-columns-div1">';var o="";this.options.visible&&(o=" checked"),this.options.canVisible||(o+=' style="display:none;"'),e+='<div class="u-grid-column-menu-columns-div2"><input type="checkbox" '+o+"></div>",e+='<span class="u-grid-column-menu-columns-span">'+this.options.title+"</span>",e+="</div></li>"}}),e+="</ul></div>",e+="</ul></div>"},s.initEventFun=function(){d.apply(this,arguments);var o=this;t("#"+this.options.id).on("mouseup",function(e){if(t(e.target).closest("#"+o.options.id+"_header").length>0){if(o.mouseUpX=e.clientX,o.mouseUpY=e.clientY,o.mouseDownX==o.mouseUpX&&o.mouseDownY==o.mouseUpY){o.columnClickX=e.clientX,o.columnClickY=e.clientY;t(e.target).closest("th")[0];if(t(e.target).hasClass("u-grid-header-columnmenu")){t("#"+o.options.id+"_column_menu").css("display","block"),t("#"+o.options.id+"_column_menu").css("right",0),t("#"+o.options.id+"_column_menu").css("top",o.headerHeight);var n=(t(i).width(),t(i).height()),s=(o.headerHeight,e.clientY,o.menuColumnsHeight);o.menuColumnsHeight+74>n?(s=n-74,t("#"+o.options.id+"_column_menu_columns").css("height",s+"px")):t("#"+o.options.id+"_column_menu_columns").css("height",""),o.ele.createColumnMenuFlag=!0}}}else t(e.target).closest("#"+o.options.id+"_content").length>0}),t(e).on("click",function(){0==o.columnMenuMove&&0==o.ele.createColumnMenuFlag&&t("#"+o.options.id+"_column_menu",o.$ele).css("display","none"),o.ele.createColumnMenuFlag=!1})},s.initGridEventFun=function(){a.apply(this,arguments);var i=this;t("#"+this.options.id+"_column_menu_ul").on("mousemove",function(t){i.columnMenuMove=!0}),t("#"+this.options.id+"_column_menu_ul").on("mouseout",function(t){i.columnMenuMove=!1}),t("#"+this.options.id+"_clearSet").on("click",function(t){i.clearLocalData(),i.initGridCompColumn(),i.dataSourceObj.sortRows(),i.repaintGridDivs(),"function"==typeof i.options.onClearSetFun&&i.options.onClearSetFun(i)}),t("#"+this.options.id+"_column_menu_columns_ul li input").on("click",function(o){var n=t(this).closest("li").attr("index");if(i.gridCompColumnArr[n].options.visible){t(this)[0].checked=!1;var s=t("input:checked",t("#"+i.options.id+"_column_menu_columns_ul")).length;if(0==s)return void(t(this)[0].checked=!0);if(8==e.documentMode){var r=t("#"+i.options.id+"_column_menu_columns")[0].scrollTop,d=t("#"+i.options.id+"_column_menu_columns")[0].style.top;i.gridCompColumnArr[n].options.visible=!1,i.repaintGridDivs(),t("#"+i.options.id+"_column_menu").css("display","block"),t("#"+i.options.id+"_column_menu").css("right","0px"),t("#"+i.options.id+"_column_menu").css("top",d),t("#"+i.options.id+"_column_menu_columns")[0].scrollTop=r}else i.setColumnVisibleByIndex(n,!1),i.gridCompColumnArr[n].options.visible=!1}else if(t(this)[0].checked=!0,8==e.documentMode){var r=t("#"+i.options.id+"_column_menu_columns")[0].scrollTop,d=t("#"+i.options.id+"_column_menu_columns")[0].style.top;i.gridCompColumnArr[n].options.visible=!0,i.repaintGridDivs(),t("#"+i.options.id+"_column_menu").css("display","block"),t("#"+i.options.id+"_column_menu").css("right","0px"),t("#"+i.options.id+"_column_menu").css("top",d),t("#"+i.options.id+"_column_menu_columns")[0].scrollTop=r}else i.setColumnVisibleByIndex(n,!0),i.gridCompColumnArr[n].options.visible=!0;i.saveGridCompColumnArrToLocal(),o.stopPropagation()}),t("#"+this.options.id+"_column_menu_columns_ul li").on("click",function(e){var o=t(this).attr("index"),n=i.gridCompColumnArr[o];if(!n.options.canVisible)return!1;if(n.options.visible){t("input",t(this))[0].checked=!1;var s=t("input:checked",t("#"+i.options.id+"_column_menu_columns_ul")).length;if(0==s)return void(t("input",t(this))[0].checked=!0);i.setColumnVisibleByIndex(o,!1),i.gridCompColumnArr[o].options.visible=!1}else t("input",t(this))[0].checked=!0,i.setColumnVisibleByIndex(o,!0),i.gridCompColumnArr[o].options.visible=!0;i.saveGridCompColumnArrToLocal()})},"undefined"==typeof s.saveGridCompColumnArrToLocal&&(s.saveGridCompColumnArrToLocal=function(){}),"undefined"==typeof s.clearLocalData&&(s.clearLocalData=function(){})}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype,r=s.initEventFun,d=s.initGridEventFun;s.createHeaderDrag=function(){return'<div class="u-grid-header-resize-handle" id="'+this.options.id+'_resize_handle"><div class="u-grid-header-resize-handle-inner"></div></div>'},s.initEventFun=function(){r.apply(this,arguments);var i=this;t("#"+this.options.id).on("mousemove",function(e){if(t(e.target).closest("#"+i.options.id+"_header").length>0){var o=t(e.target).closest("th")[0];i.headerThDrag(e,o)}i.dragFun(e),e.stopPropagation()}),t("#"+this.options.id+"_top").on("mousemove",function(t){i.dragFun(t),t.stopPropagation()}),t("#"+this.options.id).on("mouseup",function(t){i.dragEnd(t)}),t("#"+this.options.id+"_top").on("mouseup",function(t){i.dragEnd(t)})},s.initGridEventFun=function(){d.apply(this,arguments);var i=this;t("#"+this.options.id+"_resize_handle").on("mousedown",function(t){return i.dragStart(t),!1})},s.dragStart=function(t){this.dragFlag=!0,this.dragW=null,this.dragStartX=t.clientX},s.dragFun=function(i){if(this.dragFlag){var e=t("#"+this.options.id+"_resize_handle")[0].nowTh,o=t(e),n=o.attr("index"),s=this.gridCompColumnArr[n];if(nowVisibleThIndex=this.getVisibleIndexOfColumn(s),e&&s!=this.lastVisibleColumn){this.dragEndX=i.clientX;var r=this.dragEndX-this.dragStartX,d=e.attrWidth+r;cWidth=this.contentWidth+r,d>this.minColumnWidth&&(this.dragW=this.contentWidthChange(cWidth),t("#"+this.options.id+"_header_table col:eq("+nowVisibleThIndex+")").css("width",d+"px"),t("#"+this.options.id+"_content_table col:eq("+nowVisibleThIndex+")").css("width",d+"px"),
  s.options.width=d)}t("#"+this.options.id+"_top").css("display","block")}},s.dragEnd=function(i){this.dragFlag&&(this.resetThVariable(),this.saveGridCompColumnArrToLocal()),this.lastVisibleColumn.options.width=this.lastVisibleColumnWidth,this.dragW&&(this.contentWidth=this.dragW),t("#"+this.options.id+"_resize_handle")[0].nowTh=null,this.dragFlag=!1,t("#"+this.options.id+"_top").css("display","none")},"undefined"==typeof s.saveGridCompColumnArrToLocal&&(s.saveGridCompColumnArrToLocal=function(){}),s.headerThDrag=function(i,e){if(!this.dragFlag&&!this.swapColumnFlag&&e&&e.gridCompColumn&&e.gridCompColumn.options.canDrag&&t("#"+this.options.id+"_resize_handle")[0].nowTh!=e){t(e);t("#"+this.options.id+"_resize_handle").css("left",e.attrRightTotalWidth-this.scrollLeft-4+this.leftW+this.fixedWidth),t("#"+this.options.id+"_resize_handle")[0].nowTh=e}},s.resetThVariableDrag=function(i,e,o){!t("#"+this.options.id+"_resize_handle")[0].nowTh&&e.options.canDrag&&(t("#"+this.options.id+"_resize_handle").css("left",o-4+this.leftW),t("#"+this.options.id+"_resize_handle")[0].nowTh=i)}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype,r=s.initEventFun,d=t.fn.grid.dataSource;d.prototype;s.hideEditMenu=function(){t("#"+this.options.id+"_content_edit_menu").css("display","none")},s.clickFunEdit=function(i,e){var o=t(i.target).closest("tr"),n=t(i.target).closest("td"),s=n.index();if(this.options.editable&&(this.eidtRowIndex!=e||"default"==this.options.editType&&this.editColIndex!=s)){if("function"==typeof this.options.onBeforeEditFun){var r={};if(r.gridObj=this,r.rowObj=this.dataSourceObj.rows[e],r.rowIndex=e,r.colIndex=s,r.$tr=o,r.e=i,!this.options.onBeforeEditFun(r))return}this.editRowFun(o,s)}},s.editRowFun=function(t,i){this.eidtRowIndex!=-1&&this.editClose();var e="number"==typeof t?t:this.getTrIndex(t);this.eidtRowIndex=e,this.editColIndex=i,this.editRow(t,i)},s.editRowIndexFun=function(t){this.eidtRowIndex!=-1&&this.editClose(),this.eidtRowIndex=t,this.editColIndex=0,this.editRow()},s.editRow=function(i,e){if(!(e<0)){var o=this,n=!1;i&&i.parents("table").attr("id").indexOf("_fixed_")>-1&&(n=!0),i=i||t("#"+this.options.id+'_content_tbody tr[role="row"]:eq('+this.eidtRowIndex+")"),e=e||0;var s=this.dataSourceObj.rows[this.eidtRowIndex].value;if(this.editRowObj=this.cloneObj(s),"default"==this.options.editType){var r=n?this.gridCompColumnFixedArr[e]:this.gridCompColumnArr[e];if(r.options.editable){var d=t("td:eq("+e+")",i)[0],a=r.options.field,l=t(s).attr(a);l=o.getString(l,"");var h={};h.td=d,h.value=l,h.field=a,h.editType=r.options.editType,h.rowObj=o.editRowObj,h.$tr=i,h.colIndex=e,o.editCell(h)}t("#"+this.options.id+"_content_edit_menu").css("display","block"),t("#"+this.options.id+"_content_edit_menu_cancel").css("marginLeft","10px");var u=t("tr:visible",i.parent()).index(i);this.rowHeight=i.height();this.rowHeight*(u+1)+this.headerHeight+1}else if("form"==this.options.editType)if("function"==typeof this.options.formEditRenderFun){if(this.fixedWidth>0)var c=t("#"+this.options.id+"_content_fixed_table")[0];else var c=t("#"+this.options.id+"_content_table")[0];var p=c.insertRow(this.eidtRowIndex+2);p.id=this.options.id+"_edit_tr";var f=p.insertCell();f.id=this.options.id+"_edit_td",f.style.borderBottom="0px";var m=parseInt(this.contentMinWidth)+parseInt(this.fixedWidth),g='<div id="'+this.options.id+'_edit_form" class="u-grid-edit-form" style="width:'+m+'px;float:left;">';g+="</div>",f.innerHTML=g;var h={};h.grid=gridObj,h.element=t("#"+this.options.id+"_edit_form")[0],h.editRowObj=this.editRowObj,this.options.formEditRenderFun.call(this,h);var g='<div style="position:relative;float:left;width:100%;height:40px;"></div>';t("#"+this.options.id+"_edit_form")[0].insertAdjacentHTML("beforeEnd",g);var w=t("#"+this.options.id+"_edit_td")[0].offsetHeight,v=t("#"+this.options.id+"_edit_form").css("background-color");if(this.options.multiSelect){var C=t("#"+this.options.id+"_content_multiSelect > div").eq(this.eidtRowIndex),g='<div class="grid_open_edit" id="'+this.options.id+'_multiSelect_edit" style="background-color:'+v+";float:left;position:relative;width:"+this.multiSelectWidth+"px;height:"+w+'px"></div>';C[0].insertAdjacentHTML("afterEnd",g)}if(this.options.showNumCol){var C=t("#"+this.options.id+"_content_numCol > .u-grid-content-num").eq(this.eidtRowIndex),g='<div id="'+this.options.id+'_numCol_edit" style="background-color:'+v+";float:left;position:relative;width:"+this.numWidth+'px;"></div>';C[0].insertAdjacentHTML("afterEnd",g)}if(t("#"+this.options.id+"_content_edit_menu").css("display","block"),this.fixedWidth>0){var _=t("#"+this.options.id+"_content_table")[0],b=_.insertRow(this.eidtRowIndex+2);b.id=this.options.id+"_edit_tr1"}}else{if(this.fixedWidth>0)var c=t("#"+this.options.id+"_content_fixed_table")[0];else var c=t("#"+this.options.id+"_content_table")[0];var p=c.insertRow(this.eidtRowIndex+2);p.id=this.options.id+"_edit_tr";var f=p.insertCell();f.id=this.options.id+"_edit_td",f.style.borderBottom="0px";var m=parseInt(this.contentMinWidth)+parseInt(this.fixedWidth),g='<div id="'+this.options.id+'_edit_form" class="u-grid-edit-form" style="width:'+m+'px;float:left;">';if(t.each(this.gridCompColumnFixedArr,function(i){var e=!1;if(this.options.editFormShow&&(this.options.editable||!this.options.editable&&o.options.noneEditableFormShow)&&(e=!0),e){var n=this.options.field,r=t(s).attr(n);r=o.getString(r,"");var d=this.options.title,a=this.options.headerColor;g+=o.formEditCell(r,n,d,this.options.required,a)}}),t.each(this.gridCompColumnArr,function(i){var e=!1;if(this.options.editFormShow&&(this.options.editable||!this.options.editable&&o.options.noneEditableFormShow)&&(e=!0),e){var n=this.options.field,r=t(s).attr(n);r=o.getString(r,"");var d=this.options.title,a=this.options.headerColor;g+=o.formEditCell(r,n,d,this.options.required,a)}}),g+="</div>",f.innerHTML=g,t.each(this.gridCompColumnFixedArr,function(n){var r=!1;if(this.options.editFormShow&&(this.options.editable||!this.options.editable&&o.options.noneEditableFormShow)&&(r=!0),r){var d=this.options.field,a=t("#"+o.options.id+"_edit_"+d)[0],l=t(s).attr(d);this.options.title;l=o.getString(l,"");var h={};h.td=a,a.innerHTML='<div class="u-grid-content-td-div" title=""></div>',h.value=l,h.field=d,h.editType=this.options.editType,h.rowObj=o.editRowObj,h.$tr=i,h.colIndex=e,g+=o.editCell(h)}}),t.each(this.gridCompColumnArr,function(n){var r=!1;if(this.options.editFormShow&&(this.options.editable||!this.options.editable&&o.options.noneEditableFormShow)&&(r=!0),r){var d=this.options.field,a=t("#"+o.options.id+"_edit_"+d)[0],l=t(s).attr(d);this.options.title;l=o.getString(l,"");var h={};h.td=a,a.innerHTML='<div class="u-grid-content-td-div" title=""></div>',h.value=l,h.field=d,h.editType=this.options.editType,h.rowObj=o.editRowObj,h.$tr=i,h.colIndex=e,g+=o.editCell(h)}}),"function"==typeof this.options.renderEditMemu)this.options.renderEditMemu.apply(this,[t("#"+this.options.id+"_edit_form")[0],this.eidtRowIndex,this.dataSourceObj.rows.length]);else{var g='<div id="'+this.options.id+'_content_edit_menu" style="position:relative;float:left;width:100%;height:40px;"><button type="button" class="u-grid-content-edit-menu-button u-grid-content-edit-menu-button-ok" id="'+this.options.id+'_content_edit_menu_close">'+this.transMap.ml_close+"</button></div>";t("#"+this.options.id+"_edit_form")[0].insertAdjacentHTML("beforeEnd",g),t("#"+this.options.id+"_content_edit_menu_close").on("click",function(t){o.editClose()})}var w=t("#"+this.options.id+"_edit_td")[0].offsetHeight,v=t("#"+this.options.id+"_edit_form").css("background-color");if(this.options.multiSelect){var C=t("#"+this.options.id+"_content_multiSelect > div").eq(this.eidtRowIndex),g='<div class="grid_open_edit " id="'+this.options.id+'_multiSelect_edit" style="background-color:'+v+";float:left;position:relative;width:"+this.multiSelectWidth+"px;height:"+w+'px"></div>';C[0].insertAdjacentHTML("afterEnd",g)}if(this.options.showNumCol){var C=t("#"+this.options.id+"_content_numCol > .u-grid-content-num").eq(this.eidtRowIndex),g='<div id="'+this.options.id+'_numCol_edit" style="background-color:'+v+";float:left;position:relative;width:"+this.numWidth+'px;"></div>';C[0].insertAdjacentHTML("afterEnd",g)}if(t("#"+this.options.id+"_content_edit_menu").css("display","block"),this.fixedWidth>0){var _=t("#"+this.options.id+"_content_table")[0],b=_.insertRow(this.eidtRowIndex+2);b.id=this.options.id+"_edit_tr1"}}}},s.editClose=function(){var i=this.dataSourceObj.rows[this.eidtRowIndex];if(i){if("form"!=this.options.editType){var e={};e.begin=this.eidtRowIndex,e.length=1,this.renderTypeFun(e)}t("#"+this.options.id+"_content_edit_menu").css("display","none"),this.repairSumRow(),this.noRowsShowFun(),this.updateLastRowFlag(),this.eidtRowIndex=-1,t("#"+this.options.id+"_multiSelect_edit").remove(null,!0),t("#"+this.options.id+"_numCol_edit").remove(null,!0),t("#"+this.options.id+"_edit_tr").remove(null,!0),t("#"+this.options.id+"_edit_tr1").remove(null,!0)}},s.editCell=function(i){var e=i.td,o=i.value,n=i.field,s=i.editType,r=i.rowObj,d=i.$tr,a=i.colIndex,l=this,i={};if(i.td=e,i.field=n,i.$tr=d,i.colIndex=a,l.newEditObj=i,"text"==s)"default"==this.options.editType?e.innerHTML='<div class="u-grid-content-td-div" style="position: relative; left: 0px;"><div class="eType-input"><input id="'+this.options.id+"_edit_field_"+n+'" type="text" value="'+o+'" field="'+n+'" style="width:100%;margin:0px;min-height:20px;font-size:12px;color:#444"></div></div>':e.innerHTML='<div class="u-grid-content-td-div" style="position: relative; left: 0px;"><div class="eType-input"><input id="'+this.options.id+"_edit_field_"+n+'" type="text" value="'+o+'" field="'+n+'"></div></div>',t("input",t(e)).on("blur",function(){l.editValueChange(n,this.value)});else if("function"==typeof s){var i={},h=t(".u-grid-content-td-div",t(e));i.gridObj=this,i.element=h[0],i.value=o,i.field=n,i.rowObj=r,s.call(this,i)}"default"==this.options.editType&&t("input:first",t(e)).focus()},s.nextEditShow=function(){var i=this.newEditObj,e=i.td,o=i.$tr,n=parseInt(i.colIndex)+1;if(0==t(e).next("td").length){var s=o.next("tr");if(!(s.length>0))return;o=s,n=0,o.click()}this.editRowFun(o,n)},s.editValueChange=function(t,i){this.eidtRowIndex>-1&&this.eidtRowIndex<this.dataSourceObj.rows.length&&this.updateValueAt(this.eidtRowIndex,t,i)},"undefined"==typeof s.formEditCell&&(s.formEditCell=function(){}),s.updateEditRowIndex=function(t,i,e){this.eidtRowIndex<0||("-"==t?i<this.eidtRowIndex?this.eidtRowIndex--:i==this.eidtRowIndex&&(this.eidtRowIndex=-1):"+"==t&&(e===o&&(e=1),i<=this.eidtRowIndex&&(this.eidtRowIndex+=e)))},s.updateValueAtEdit=function(i,e,o,n){this.eidtRowIndex==i&&t("#"+this.options.id+"_edit_field_"+e).length>0&&("checkbox"==t("#"+this.options.id+"_edit_field_"+e)[0].type?"Y"==o||"true"==o?t("#"+this.options.id+"_edit_field_"+e)[0].checked=!0:t("#"+this.options.id+"_edit_field_"+e)[0].checked=!1:t("#"+this.options.id+"_edit_field_"+e)[0].value=o)},s.setEditType=function(t,i){var e=this.getColumnByField(t);e.options.editType=i},s.setEditable=function(t){this.options.editable=t},s.initEventFun=function(){r.apply(this,arguments);var i=this;t(e).on("click",function(e){if(i.options.editable&&"default"==i.options.editType){var o=t(e.target),n=!0;n=!(t(e.target).closest(".u-grid-content-td-div").length>0)&&n;var s=i.options.customEditPanelClass;if(s){var r=s.split(",");t.each(r,function(){n=!(o.closest("."+this).length>0)&&n})}"grid-for-edit"==o.attr("role")&&(n=!1),n&&i.editClose()}}),u.on(e,"scroll",function(){i.editClose()})},s.setGridEditType=function(t){this.options.editType=t},s.setGridEditTypeAndEditRow=function(i,e,o){this.options.editType=i;var n=t("#"+this.options.id+"_content_tbody"),s=t("tr:eq("+e+")",n);this.editRowFun(s,o)}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype,r=s.initDefault,d=s.setRequired;s.initDefault=function(){r.apply(this,arguments),this.defaults=t.extend(!0,{},this.defaults,{noneEditableFormShow:!0})},s.setRequired=function(i,e){d.apply(this,arguments);var o=this;t.each(this.gridCompColumnArr,function(n){this.options.field==i&&(this.options.required=e,e?t("#"+o.options.id+"_edit_"+this.options.field).parent().find(".u-grid-edit-mustFlag").show():t("#"+o.options.id+"_edit_"+this.options.field).parent().find(".u-grid-edit-mustFlag").hide())})},s.editorRowChangeFun=function(){if(t("#"+this.options.id+"_edit_form").length>0){var i=t("#"+this.options.id+"_edit_form")[0].offsetHeight;t("#"+this.options.id+"_numCol_edit").css("height",i),t("#"+this.options.id+"_multiSelect_edit").css("height",i)}},s.formEditCell=function(t,i,e,o,n){var s=e+"";s.lengthb()>28&&(s=s.substrCH(26)+"...");var r='<div class="u-grid-edit-whole-div"><div class="u-grid-edit-label"><div title="'+e+'" style="color:'+n+'">'+s+'<span style="color:red;'+(o?"":"display: none")+'" class="u-grid-edit-mustFlag">*</span></div></div>';return r+='<div id="'+this.options.id+"_edit_"+i+'" class="u-grid-edit-div"></div>',r+="</div>"}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype,r=s.columnsVisibleFun;s.initGridCompFixedColumn=function(){var i=this;t.each(this.gridCompColumnArr,function(t){1==this.options.fixed&&i.gridCompColumnFixedArr.push(this)}),t.each(this.gridCompColumnFixedArr,function(t){for(var t=i.gridCompColumnArr.length;t>-1;t--)if(i.gridCompColumnArr[t]==this){i.gridCompColumnArr.splice(t,1);break}})},s.columnsVisibleFun=function(){r.apply(this,arguments);var i=this,e=0;t.each(this.gridCompColumnFixedArr,function(){this.options.visible&&(e+=parseInt(this.options.width),this.firstColumn=i.firstColumn,i.firstColumn=!1)}),this.fixedRealWidth=e},s.createHeaderTableFixed=function(){return this.createHeaderTable("fixed")},s.createContentTableFixed=function(){return this.createContentTable("fixed")},s.createContentOneRowFixed=function(t){return this.createContentOneRow(t,"fixed")},s.widthChangeGridFunFixed=function(t){this.fixedRealWidth>t?this.fixedWidth=t:this.fixedWidth=this.fixedRealWidth}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype;s.createFromDivs=function(){if(!this.createFormFlag){var i='<div id="'+this.options.id+'_form" class="u-grid-form">';i+=this.createFromContent(),t("#"+this.options.id)[0].insertAdjacentHTML("afterBegin",i),this.createFormFlag=!0}},s.createFromContent=function(){var t='<div class="u-grid-form-content" id="'+this.options.id+'_form_content" class="u-grid-content">';return t+='<table role="grid" id="'+this.options.id+'_form_content_table">',t+=this.createFormContentRows(),t+="</table>"},s.createFormContentRows=function(){var i=this,e="";return this.dataSourceObj.rows&&(e+='<tbody role="rowgroup" id="'+this.options.id+'_form_content_tbody">',t.each(this.dataSourceObj.rows,function(){e+='<tr role="row"><td role="rowcell">';var o=this.value;t.each(i.gridCompColumnArr,function(){var i=this.options.field,n=this.options.title,s=t(o).attr(i);e+="<div>"+n+":</div>",e+="<div>"+s+"</div>"}),e+="</td></tr>"}),e+="</tbody>"),e},s.widthChangeFormFun=function(){this.createFromDivs(),t("#"+this.options.id+"_grid").css("display","none"),t("#"+this.options.id+"_form").css("display","block"),this.showType="form","function"==typeof this.options.afterCreate&&this.options.afterCreate.call(this)}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype;s.resetThVariableHeaderLevel=function(){var i=this,e="",o=0;t("#"+this.options.id+"_header_table th",this.$ele).each(function(n){var s=i.gridCompColumnArr[n],r=i.getString(s.options.parentHeader,""),d=0;if(s.options.visible&&(d=s.options.width),""!=e&&r!=e&&t("#"+i.options.id+e).css("width",o-1+"px"),""!=r){var a=i.getLevelTitleByField(r);if(r!=e&&(o=0,!i.parentFlag)){var l='<div id="'+i.options.id+r+'" class="u-gird-parent"><div class="u-grid-header-link" title="'+a+'">'+a+"</div></div>";this.insertAdjacentHTML("afterBegin",l)}o+=d}e=r}),""!=e&&t("#"+i.options.id+e).css("width",o-1+"px"),this.parentFlag=!0},s.initGridCompColumnHeaderLevelFun=function(t){if(t.headerLevel>1){this.gridCompLevelColumn.push(t);var i=this.gridCompColumnArr.length;this.gridCompColumnArr.length=i-1,this.basicGridCompColumnArr&&this.basicGridCompColumnArr.length>0&&(this.basicGridCompColumnArr.length=i-1)}},s.initGridHiddenLevelColumn=function(){if(this.options.overWidthHiddenColumn){this.gridCompHiddenLevelColumnArr=this.gridCompColumnArr.slice(0),this.gridCompHiddenLevelColumnArr.sort(function(t,i){var e=t.options.hiddenLevel,o=i.options.hiddenLevel;return e>o?-1:1})}},s.getLevelTitleByField=function(t){for(var i=0;i<this.gridCompLevelColumn.length;i++){var e=this.gridCompLevelColumn[i].field;if(e==t)return this.gridCompLevelColumn[i].title}return""}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype;s.initGridHiddenLevelColumn=function(){if(this.options.overWidthHiddenColumn){this.gridCompHiddenLevelColumnArr=this.gridCompColumnArr.slice(0),this.gridCompHiddenLevelColumnArr.sort(function(t,i){var e=t.options.hiddenLevel,o=i.options.hiddenLevel;return e>o?-1:1})}},s.widthChangeGridFunOverWidthHidden=function(){if(this.options.overWidthHiddenColumn){this.lastVisibleColumn.options.width=this.lastVisibleColumn.options.realWidth;var t=parseInt(this.wholeWidth)-parseInt(this.leftW),i=parseInt(this.fixedWidth)+parseInt(this.contentRealWidth);if(i>t){for(var e=0;e<this.gridCompHiddenLevelColumnArr.length;e++){var o=this.gridCompHiddenLevelColumnArr[e];if(o.options.visible&&(o.options.visible=!1,i-=o.options.width),!(i>t))break}this.columnsVisibleFun()}else{for(var e=this.gridCompHiddenLevelColumnArr.length-1;e>-1;e--){var o=this.gridCompHiddenLevelColumnArr[e];if(!o.options.visible){if(i+=o.options.width,i>t)break;o.options.visible=!0}}this.columnsVisibleFun()}}}}(jQuery,window,document),function($,window,document,undefined){var gridComp=$.fn.grid.gridComp,gridCompProto=gridComp.prototype,initEventFunFun=gridCompProto.initEventFun,initGridEventFunFun=gridCompProto.initGridEventFun,dataSource=$.fn.grid.dataSource,dataSourceProto=dataSource.prototype;gridCompProto.initEventFun=function(){initEventFunFun.apply(this,arguments);var t=this;$("#"+this.options.id).on("mouseup",function(i){if($(i.target).closest("#"+t.options.id+"_header").length>0){if(t.mouseUpX=i.clientX,t.mouseUpY=i.clientY,t.mouseDownX==t.mouseUpX&&t.mouseDownY==t.mouseUpY){t.columnClickX=i.clientX,t.columnClickY=i.clientY;var e=$(i.target).closest("th")[0];$(i.target).hasClass("u-grid-header-columnmenu")||t.canSortable(i,e)}}else $(i.target).closest("#"+t.options.id+"_content").length>0})},gridCompProto.initGridEventFun=function(){initGridEventFunFun.apply(this,arguments)},gridCompProto.canSortable=function(t,i){var e=this,o=$(i),n=o.attr("field"),s=this.getColumnAttr("sortable",n);if(s){if(t.ctrlKey){var r=[];$(".u-grid-header-sort-priority").each(function(t,i){var e,o=$(i),n=parseInt(o.text()),s=o.closest("th").attr("field");o.parent().hasClass("uf-caretarrowup")?e="asc":o.parent().hasClass("uf-caretdown")&&(e="desc"),r[n-1]={field:s,sortType:e}});var d;if((d=o.find(".uf-caretarrowup")).length>0){var a=parseInt(d.find(".u-grid-header-sort-priority").text());r[a-1].sortType="desc",d.removeClass("uf-caretarrowup").addClass("uf-caretdown")}else if((d=o.find(".uf-caretdown")).length>0){for(var a=parseInt(d.find(".u-grid-header-sort-priority").text()),l=a;l<r.length;l++){var h=$("[field="+r[l].field+"]").find(".u-grid-header-sort-priority");h.text(parseInt(h.text())-1)}r.splice(a-1,1),d.remove()}else r.push({field:n,sortType:"asc"}),o.first().first().append('<span class="uf uf-caretarrowup u-grid-header-sort-span" ></span>');this.dataSourceObj.sortRowsByPrio(r)}else $(".uf-caretarrowup").parent().parent().parent()[0]==i?($(".uf-caretarrowup").remove(),$(i.firstChild.firstChild)[0].insertAdjacentHTML("beforeEnd",'<span class="uf uf-caretdown u-grid-header-sort-span" ></span>'),"function"==typeof this.options.onSortFun?this.options.onSortFun(n,"asc"):this.dataSourceObj.sortRows(n,"asc")):$(".uf-caretdown").parent().parent().parent()[0]==i?($(".uf-caretdown").remove(),"function"==typeof this.options.onSortFun?this.options.onSortFun():this.dataSourceObj.sortRows()):($(".uf-caretarrowup").remove(),$(".uf-caretdown").remove(),$(i.firstChild.firstChild)[0].insertAdjacentHTML("beforeEnd",'<span class="uf uf-caretarrowup u-grid-header-sort-span"></span>'),"function"==typeof this.options.onSortFun?this.options.onSortFun(n,"desc"):this.dataSourceObj.sortRows(n,"desc"));e.repairContent(),e.afterGridDivsCreate()}},gridCompProto.deleteOneRowTree=function(){this.options.showTree&&this.dataSourceObj.sortRows()},gridCompProto.sortRowsByPrio=function(prioArray,cancelSort){var oThis=this;cancelSort&&(this.rows=new Array,this.options.values&&$.each(this.options.values,function(t){var i={};i.value=this,i.valueIndex=t,oThis.rows.push(i)}));var evalStr=function(t){return t==prioArray.length-1?"by(prioArray["+t+"].field, prioArray["+t+"].sortType)":"by(prioArray["+t+"].field, prioArray["+t+"].sortType,"+evalStr(t+1)+")"},by=function(t,i,e){arguments.callee;return function(o,n){var s=$(o.value).attr(t),r=$(n.value).attr(t),d=oThis.gridComp.getColumnByField(t).options.dataType;if("Float"==d)return s=parseFloat(s),r=parseFloat(r),isNaN(s)?1:isNaN(r)?-1:s==r&&e?e():"asc"==i?s-r:r-s;if("Int"==d)return s=parseInt(s),r=parseInt(r),isNaN(s)?1:isNaN(r)?-1:s==r&&e?e():"asc"==i?s-r:r-s;s=oThis.gridComp.getString(s,""),r=oThis.gridComp.getString(r,"");try{var a=s.localeCompare(r);return 0===a&&e?e():0===a?0:"asc"==i?a:-a}catch(l){return 0}}};this.rows.sort(eval(evalStr(0)))},dataSourceProto.basicSortRows=function(t,i){var e=this,o="";t&&(o=this.gridComp.getColumnByField(t).options.dataType),"asc"==i?this.rows.sort(function(i,n){var s=$(n.value).attr(t),r=$(i.value).attr(t);if("Float"==o)return s=parseFloat(s),r=parseFloat(r),isNaN(s)?1:isNaN(r)?-1:s-r;if("Int"==o)return s=parseInt(s),r=parseInt(r),isNaN(s)?1:isNaN(r)?-1:s-r;s=e.gridComp.getString(s,""),r=e.gridComp.getString(r,"");try{return s.localeCompare(r)}catch(d){return 0}}):"desc"==i?this.rows.sort(function(i,n){var s=$(i.value).attr(t),r=$(n.value).attr(t);if("Float"==o)return s=parseFloat(s),r=parseFloat(r),isNaN(s)?1:isNaN(r)?-1:s-r;if("Int"==o)return s=parseInt(s),r=parseInt(r),isNaN(s)?1:isNaN(r)?-1:s-r;s=e.gridComp.getString(s,""),r=e.gridComp.getString(r,"");try{return s.localeCompare(r)}catch(d){return 0}}):(this.rows=new Array,this.options.values&&$.each(this.options.values,function(t){var i={};i.value=this,i.valueIndex=t,e.rows.push(i)}))}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype;s.createContentRowsSumRow=function(t){var i="";return this.options.showSumRow&&this.dataSourceObj.rows&&this.dataSourceObj.rows.length>0&&(i+=this.createSumRow(t)),i},s.createContentSumRow=function(t){var i="";return this.options.showSumRow&&(i+='<div class="u-grid-content-left-sum-bottom" id="'+this.options.id+'_content_left_sum_bottom" style="width:'+(this.leftW+this.fixedWidth)+"px;"+t+'">',i+="</div>"),i},s.createSumRow=function(i){if(this.options.showSumRow){var e,o,n=this;"fixed"==i?(e="fixed_",o=this.gridCompColumnFixedArr):(e="",o=this.gridCompColumnArr);var s=parseInt(this.wholeHeight)-this.exceptContentHeight-48-this.scrollBarHeight;s=s>0?s:0;var r='<tr role="row" class="u-grid-content-sum-row" id="'+this.options.id+"_content_"+e+'sum_row" style="top:'+s+'px;">';return t.each(o,function(){var t=this.options.field,i=this.options.precision,e=this.options.dataType,o=n.dataSourceObj.getSumValue(t,this,n);if("float"==e){var s={};s.value=o,s.precision=i?i:2,o=n.DicimalFormater(s)}var d="";this.options.visible||(d='style="display:none;"'),r+='<td role="rowcell" title="'+o+'" '+d+">",this.firstColumn&&(r+='<div class="u-gird-centent-sum-div"><span>'+n.transMap.ml_sum+"</span></div>");var a="";"integer"!=this.options.dataType&&"float"!=this.options.dataType||(a='style="text-align: right;"'),r+='<div class="u-grid-content-td-div" '+a+'><span value="'+o+'">'+o+"</span></div></td>"}),r+="</tr>"}},s.createSumRowForIE=function(i,e){if(this.options.showSumRow){var o,n,s=this;"fixed"==e?(o="fixed_",n=this.gridCompColumnFixedArr):(o="",n=this.gridCompColumnArr);var r=parseInt(this.wholeHeight)-this.exceptContentHeight-48-this.scrollBarHeight;r=r>0?r:0;var d=i.insertRow();d.row="row",d.className="u-grid-content-sum-row",d.id=this.options.id+"_content_"+o+"sum_row",d.style.top=r+"px",t.each(n,function(){var t=this.options.field,i=this.options.precision,e=this.options.dataType,o=s.dataSourceObj.getSumValue(t,this,s);if("float"==e){var n={};n.value=o,n.precision=i?i:2,o=s.DicimalFormater(n)}var r=d.insertCell();r.role="rowcell",r.title=o;var a="";"integer"!=this.options.dataType&&"float"!=this.options.dataType||(a='style="text-align: right;"');var l='<div class="u-grid-content-td-div" '+a+">";this.firstColumn&&(l+='<div class="u-gird-centent-sum-div"><span>'+s.transMap.ml_sum+"</span></div>"),l+='<span value="'+o+'">'+o+"</span></div>",r.insertAdjacentHTML("afterBegin",l)})}},s.repairSumRow=function(){if(this.options.showSumRow){t("#"+this.options.id+"_content_div tbody .u-grid-content-sum-row").remove(),t("#"+this.options.id+"_content_fixed_div tbody .u-grid-content-sum-row").remove();try{if(this.dataSourceObj.rows&&this.dataSourceObj.rows.length>0){var i=this.createSumRow();t("#"+this.options.id+"_content_div tbody")[0].insertAdjacentHTML("beforeEnd",i);var i=this.createSumRow("fixed");t("#"+this.options.id+"_content_fixed_div tbody")[0]&&t("#"+this.options.id+"_content_fixed_div tbody")[0].insertAdjacentHTML("beforeEnd",i)}}catch(e){var o=t("#"+this.options.id+"_content_div table")[0];t("#"+this.options.id+"_content_fixed_div table")[0];this.createSumRowForIE(o),this.createSumRowForIE(o,"fixed")}this.renderSumRow()}},s.renderSumRow=function(){var i=this;t.each(this.gridCompColumnFixedArr,function(e){var o=this.options.sumCol,n=this.options.sumRenderType,s="fixed_";if(o){var r=t("#"+i.options.id+"_content_"+s+"sum_row").find("td").eq(e).find("span"),d=r[r.length-1];if(d)if("function"==typeof n){var a=t(d).attr("value"),l={};l.value=a,l.element=d,l.gridObj=i,l.gridCompColumn=this,n.call(i,l)}else"integer"!=dataType&&"float"!=dataType||(d.style.textAlign="right")}}),t.each(this.gridCompColumnArr,function(e){var o=this.options.sumCol,n=this.options.sumRenderType,s="";if(o){var r=t("#"+i.options.id+"_content_"+s+"sum_row").find("td").eq(e).find("span"),d=r[r.length-1];if(d)if("function"==typeof n){var a=t(d).attr("value"),l={};l.value=a,l.element=d,l.gridObj=i,l.gridCompColumn=this,n.call(i,l)}else"integer"!=dataType&&"float"!=dataType||(d.style.textAlign="right")}})},s.renderTypeSumRow=function(i,e,o,n,s){var r=this,d=i.options.sumCol,a=i.options.sumRenderType,l=i.options.dataType,h=s===!0?"fixed_":"";if(d){var u=t("#"+this.options.id+"_content_"+h+"sum_row").find("td").eq(e).find("span"),c=u[u.length-1];if(c)if("function"==typeof a){var p=t(c).attr("value"),f={};f.value=p,f.element=c,f.gridObj=r,f.gridCompColumn=i,a.call(r,f)}else"integer"!=l&&"float"!=l||(c.style.textAlign="right")}}}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype,r=s.initEventFun,d=s.initGridEventFun;s.initEventFun=function(){r.apply(this,arguments);var i=this;t("#"+this.options.id).on("mousedown",function(e){if(t(e.target).closest("#"+i.options.id+"_header").length>0){var o=t(e.target).closest("th")[0];i.options.canSwap&&i.swapColumnStart(e,o),e.preventDefault()}else t(e.target).closest("#"+i.options.id+"_content").length>0}),t("#"+this.options.id).on("mousemove",function(t){i.mouseMoveX=t.clientX,i.mouseMoveY=t.clientY,i.mouseMoveX==i.mouseDownX&&i.mouseDownY==i.mouseMoveY||"mouseDownX"==i.mouseDownX||!i.options.canSwap||(i.swapColumnFlag=!0),i.swapColumnFun(t),t.stopPropagation()}),t("#"+this.options.id+"_top").on("mousemove",function(t){i.mouseMoveX=t.clientX,i.mouseMoveY=t.clientY,i.mouseMoveX==i.mouseDownX&&i.mouseDownY==i.mouseMoveY||"mouseDownX"==i.mouseDownX||!i.options.canSwap||(i.swapColumnFlag=!0),i.swapColumnFun(t),t.stopPropagation()}),t("#"+this.options.id).on("mouseup",function(t){i.mouseUpX=t.clientX,i.mouseUpY=t.clientY,i.swapColumnEnd(t),i.mouseUpX="mouseUpX",i.mouseUpY="mouseUpY",i.mouseDownX="mouseDownX",i.mouseDownY="mouseDownY",i.mouseMoveX="mouseMoveX",i.mouseMoveY="mouseMoveY"}),t("#"+this.options.id+"_top").on("mouseup",function(t){i.mouseUpX=t.clientX,i.mouseUpY=t.clientY,i.swapColumnEnd(t),i.mouseUpX="mouseUpX",i.mouseUpY="mouseUpY",i.mouseDownX="mouseDownX",i.mouseDownY="mouseDownY",i.mouseMoveX="mouseMoveX",i.mouseMoveY="mouseMoveY"})},s.initGridEventFun=function(){d.apply(this,arguments)},s.swapColumnStart=function(t,i){this.options.canSwap&&(this.swapColumnEle=i,this.swapColumnStartX=t.clientX,this.swapColumnStartY=t.clientY)},s.swapColumnFun=function(i){if(this.options.canSwap){var e=this;if(this.swapColumnFlag){var o=this.swapColumnEle,n=t(o),s=o.gridCompColumn;if(0==t("#"+this.options.id+"_clue").length){var r=t('<div class="u-grid u-grid-header-drag-clue" id="'+this.options.id+'_clue" />').css({width:o.scrollWidth+"px",left:o.attrLeftTotalWidth-e.scrollLeft+e.leftW+e.fixedWidth+"px",top:"0px",paddingLeft:n.css("paddingLeft"),paddingRight:n.css("paddingRight"),lineHeight:n.height()+"px",paddingTop:n.css("paddingTop"),paddingBottom:n.css("paddingBottom")}).html(s.options.title||s.options.field).prepend('<span class="uf uf-bancirclesymbol u-grid-header-drag-status" />');try{t("#"+this.options.id)[0].insertAdjacentElement("afterBegin",r[0])}catch(i){t("#"+this.options.id)[0].insertBefore(r[0],t("#"+this.options.id)[0].firstChild)}r.on("mousemove",function(){i.stopPropagation()})}this.swapColumnEndX=i.clientX,this.swapColumnEndY=i.clientY;var d=this.swapColumnEndX-this.swapColumnStartX,a=this.swapColumnEndY-this.swapColumnStartY;if(t("#"+this.options.id+"_clue").css({left:o.attrLeftTotalWidth+d-e.scrollLeft+e.leftW+e.fixedWidth+"px",top:a+"px"}),0==t("#"+this.options.id+"_swap_top").length){var r=t('<span class="uf uf-sortdown u-grid-header-swap-tip-span"  id="'+this.options.id+'_swap_top"/>');r.css({top:n.height()-6+"px"});var l=t('<span class="uf uf-sortup u-grid-header-swap-tip-span" id="'+this.options.id+'_swap_down" />');l.css({top:"6px"});try{t("#"+this.options.id)[0].insertAdjacentElement("afterBegin",r[0]),t("#"+this.options.id)[0].insertAdjacentElement("afterBegin",l[0])}catch(i){t("#"+this.options.id)[0].insertBefore(r[0],t("#"+this.options.id)[0].firstChild),t("#"+this.options.id)[0].insertBefore(l[0],t("#"+this.options.id)[0].firstChild)}}this.canSwap=!1,t("#"+this.options.id+"_header_table th").each(function(o){var n=t(this).offset().left,s=n+parseInt(this.attrWidth);if(0==o&&i.clientX<n)e.swapColumnEle!=this&&(e.swapToColumnEle="LeftEle",t("#"+e.options.id+"_swap_top").css({left:-e.scrollLeft-3+e.leftW+e.fixedWidth+"px",display:"block"}),t("#"+e.options.id+"_swap_down").css({left:-e.scrollLeft-3+e.leftW+e.fixedWidth+"px",display:"block"})),e.canSwap=!0;else if(n<i.clientX&&i.clientX<s&&e.swapColumnEle!=this&&parseInt(t(this).attr("index"))+1!=parseInt(t(e.swapColumnEle).attr("index")))return e.swapToColumnEle!=this&&(e.swapToColumnEle=this,t("#"+e.options.id+"_swap_top").css({left:this.attrRightTotalWidth-e.scrollLeft-3+e.leftW+e.fixedWidth+"px",display:"block"}),t("#"+e.options.id+"_swap_down").css({left:this.attrRightTotalWidth-e.scrollLeft-3+e.leftW+e.fixedWidth+"px",display:"block"})),e.canSwap=!0,!1}),this.canSwap?t(".u-grid-header-drag-status").removeClass("uf-bancirclesymbol").addClass("uf-plussigninablackcircle"):(t("#"+this.options.id+"_swap_top").css("display","none"),t("#"+this.options.id+"_swap_down").css("display","none"),t(".u-grid-header-drag-status").removeClass("uf-plussigninablackcircle").addClass("uf-bancirclesymbol"),this.swapToColumnEle=null),t("#"+this.options.id+"_top").css("display","block")}}},s.swapColumnEnd=function(i){if(this.options.canSwap){if(this.swapColumnFlag){if(this.swapToColumnEle){
  var e=this.swapColumnEle,o=this.swapToColumnEle,n=t(e).attr("index"),s=t(o).attr("index"),r=this.gridCompColumnArr[n];this.gridCompColumnArr.splice(parseInt(s)+1,0,r),n<s?this.gridCompColumnArr.splice(n,1):this.gridCompColumnArr.splice(parseInt(n)+1,1),this.saveGridCompColumnArrToLocal(),this.repaintGridDivs()}t("#"+this.options.id+"_clue").remove(),t("#"+this.options.id+"_swap_top").css("display","none"),t("#"+this.options.id+"_swap_down").css("display","none")}this.swapColumnFlag=!1,t("#"+this.options.id+"_top").css("display","none")}},"undefined"==typeof s.saveGridCompColumnArrToLocal&&(s.saveGridCompColumnArrToLocal=function(){})}(jQuery,window,document),function(t,i,e,o){var n=t.fn.grid.gridComp,s=n.prototype,r=t.fn.grid.gridCompColumn,d=r.prototype,a=t.fn.grid.dataSource,l=a.prototype;d.initTree=function(t,i){return i.showTree&&(t.sortable=!1),t},s.initOptionsTree=function(){this.options.showTree&&(this.options.showNumCol=!1)},s.clickFunTree=function(i){var e=this,o=t(i.target),n=o.closest("td");if(n.length>0){var s=n.parent(),r=this.getTrIndex(s),d=e.dataSourceObj.rows[r];if(d){var a=d.childRowIndex;if(o.hasClass("uf-minusbutton")||o.hasClass("uf-addsquarebutton2")){var l=n.find(".uf-minusbutton"),h=n.find(".uf-addsquarebutton2");if(l.length>0){if(l.removeClass("uf-minusbutton").addClass("uf-addsquarebutton2"),a.length>0){var u=e.getAllChildRowIndex(d);t.each(u,function(){var i=t('tr[role="row"]:eq('+parseInt(this)+")",s.parent());i.css("display","none"),t("#"+e.options.id+"_content_multiSelect >div:nth-child("+(parseInt(this)+1)+")").css("display","none"),t(".uf-minusbutton",i).removeClass("uf-minusbutton").addClass("uf-addsquarebutton2")})}return void("form"==this.options.editType&&(t("#"+this.options.id+"_multiSelect_edit").remove(null,!0),t("#"+this.options.id+"_numCol_edit").remove(null,!0),t("#"+this.options.id+"_edit_tr").remove(null,!0),t("#"+this.options.id+"_edit_tr1").remove(null,!0)))}if(h.length>0)return h.removeClass("uf-addsquarebutton2").addClass("uf-minusbutton"),void(a.length>0&&t.each(a,function(){var i=t('tr[role="row"]:eq('+parseInt(this)+")",s.parent());i.css("display","");t("#"+e.options.id+"_content_multiSelect >div:nth-child("+(parseInt(this)+1)+")")[0];t("#"+e.options.id+"_content_multiSelect >div:nth-child("+(parseInt(this)+1)+")").css("display","")}))}}}},s.addOneRowTree=function(i,e,o){var n=this,s=this.dataSourceObj.rows.length;if(this.options.showTree){this.hasParent=!1,this.hasChildF=!1;var r=this.options.keyField,d=this.options.parentKeyField,a=this.getString(t(i).attr(r),"");o.keyValue=a;var l=this.getString(t(i).attr(d),"");if(o.parentKeyValue=l,t.each(this.dataSourceObj.rows,function(i){var s=this.value,h=n.getString(t(s).attr(r),""),u=n.getString(t(s).attr(d),"");if(h==l){n.hasParent=!0,n.addRowParentIndex=i,parentChildLength=n.getAllChildRow(this).length;var c=this.level;if(o.level=c+1,e=n.addRowParentIndex+parentChildLength+1,!n.options.needTreeSort)return!1}if(u==a&&(n.hasChildF=!0),n.hasParent&&n.hasChildF)return!1}),this.hasParent||(o.level=0,e!=s&&(e=s)),this.hasParent){var h=t("#"+this.options.id+"_content_div").find("tbody").find('tr[role="row"]').eq(n.addRowParentIndex);if(parentChildLength>0){var u=t(".uf-addsquarebutton2",h);u.length>0||(displayFlag="block")}else{this.options.autoExpand&&(displayFlag="block");var c=t("div:eq(0)",h),u=t(".uf-addsquarebutton2",h),p=t(".uf-minusbutton",h);if(this.options.autoExpand)var f='<span class="uf u-grid-content-tree-span uf-minusbutton"></span>';else var f='<span class="uf u-grid-content-tree-span uf-addsquarebutton2"></span>';if(c.length>0&&0==u.length&&0==p.length){c[0].insertAdjacentHTML("afterBegin",f);var m=parseInt(c[0].style.left);s=m-16,(s>0||0==s)&&(c[0].style.left=s+"px")}u.length>0&&u.removeClass("uf-addsquarebutton2").addClass("uf-minusbutton")}}}return e},s.addOneRowTreeHasChildF=function(t){if(this.hasChildF)this.dataSourceObj.sortRows(),this.repairContent();else{if(this.hasParent){var i=this.dataSourceObj.rows[this.addRowParentIndex];i.hasChild=!0,i.childRow.push(t),i.childRowIndex.push(t.valueIndex),t.parentRow=i,t.parentRowIndex=this.addRowParentIndex}t.hasChild=!1,t.childRow=new Array,t.childRowIndex=new Array}},s.updateValueAtTree=function(i,e,o,n){var s=this,r=this.options.keyField,d=this.options.parentKeyField;if(this.options.showTree&&(e==r||e==d)){var a=!1,l=!1;if(t.each(this.dataSourceObj.rows,function(i){var n=this.value,h=s.getString(t(n).attr(r),""),u=s.getString(t(n).attr(d),"");e==r&&o==u&&(l=!0),e==d&&o==h&&(a=!0)}),l||a){var h=t(this.dataSourceObj.rows[i].value);this.deleteOneRow(i),this.addOneRow(h[0])}}return!this.options.showTree||e!=r&&e!=d||!l&&!a||(i=this.getRowIndexByValue(e,o)),i},s.getAllChildRow=function(t){return t.allChildRow=new Array,this.getAllChildRowFun(t,t.allChildRow),t.allChildRow},s.getAllChildRowIndex=function(t){return t.allChildRowIndex=new Array,this.getAllChildRowIndexFun(t,t.allChildRowIndex),t.allChildRowIndex},s.getAllChildRowFun=function(i,e){var o=this;i.childRow.length>0&&(Array.prototype.push.apply(e,i.childRow),t.each(i.childRow,function(){o.getAllChildRowFun(this,e)}))},s.getAllChildRowIndexFun=function(i,e){var o=this;i.childRowIndex.length>0&&(Array.prototype.push.apply(e,i.childRowIndex),t.each(i.childRow,function(){o.getAllChildRowIndexFun(this,e)}))},s.expandNode=function(t){var i=this.getRowIndexByValue(this.options.keyField,t);this.expandNodeByIndex(i)},s.expandNodeByIndex=function(i){for(var e,o=this.getRowByIndex(i),n=!1,s=new Array,r=o;!n;){if(""==r.parentKeyValue){n=!0;break}e=r.parentRowIndex,r=r.parentRow;var d=t("#"+this.options.id+"_content_div").find("tbody").find('tr[role="row"]').eq(e),a=t(".uf-addsquarebutton2",d);if(!(a.length>0)){n=!0;break}s.push(e)}if(s.length>0)for(var l=s.length-1;l>-1;l--){var h=s[l],d=t("#"+this.options.id+"_content_div").find("tbody").find('tr[role="row"]').eq(h),a=t(".uf-addsquarebutton2",d);a.click()}var u=t("#"+this.options.id+"_content_div").find("tbody").find('tr[role="row"]').eq(i),a=t(".uf-addsquarebutton2",u),c=t(".u-grid-content-td-div",u);a.length>0?a.click():c.click()},l.treeSortRows=function(i,e){var o=this;if(this.rows=new Array,this.hasParentRows=new Array,this.nothasParentRows=new Array,this.options.values){t.each(this.options.values,function(i){var e={},n=t(this),s=o.gridComp.options.keyField,r=o.gridComp.options.parentKeyField,d=o.gridComp.getString(n.attr(s),""),a=o.gridComp.getString(n.attr(r),"");e.valueIndex=i,e.value=this,e.keyValue=d,e.parentKeyValue=a,""==a?o.nothasParentRows.push(e):o.hasParentRows.push(e),o.rows.push(e)}),t.each(this.hasParentRows,function(i){var e=this.parentKeyValue,n=!1;t.each(o.rows,function(){this.keyValue==e&&(n=!0)}),n||(o.hasParentRows.splice(i,0),o.nothasParentRows.push(this))}),o.rows=new Array;var n=0;t.each(this.nothasParentRows,function(t){this.level=n,o.rows.push(this),o.pushChildRows(this,n)})}},l.pushChildRows=function(i,e){var o=i.keyValue,n=this,s=parseInt(e)+1,r=!1,d=new Array,a=new Array;t.each(this.hasParentRows,function(t){if(this&&this.parentKeyValue==o){r=!0,this.level=s,n.rows.push(this),d.push(this);var i=parseInt(n.rows.length-1);a.push(i),n.hasParentRows.splice(t,0),n.pushChildRows(this,s)}}),i.hasChild=r,i.childRow=d,i.childRowIndex=a}}(jQuery,window,document),u.GridAdapter=u.BaseAdapter.extend({initialize:function(options){var opt=options.options||{},viewModel=options.model,element="string"==typeof options.el?document.querySelector(options.el):options.el,app=options.app;this.id=opt.id,options=opt;var oThis=this,compDiv=null,comp=null;this.dataTable=u.getJSObject(viewModel,options.data),this.element=element,this.$element=$(element),this.editComponentDiv={},this.editComponent={},this.id=options.id,this.gridOptions=options,this.gridOptions.onBeforeRowSelected=u.getFunction(viewModel,this.gridOptions.onBeforeRowSelected),this.gridOptions.onRowSelected=u.getFunction(viewModel,this.gridOptions.onRowSelected),this.gridOptions.onBeforeRowUnSelected=u.getFunction(viewModel,this.gridOptions.onBeforeRowUnSelected),this.gridOptions.onRowUnSelected=u.getFunction(viewModel,this.gridOptions.onRowUnSelected),this.gridOptions.onBeforeAllRowSelected=u.getFunction(viewModel,this.gridOptions.onBeforeAllRowSelected),this.gridOptions.onAllRowSelected=u.getFunction(viewModel,this.gridOptions.onAllRowSelected),this.gridOptions.onBeforeAllRowUnSelected=u.getFunction(viewModel,this.gridOptions.onBeforeAllRowUnSelected),this.gridOptions.onAllRowUnSelected=u.getFunction(viewModel,this.gridOptions.onAllRowUnSelected),this.gridOptions.onBeforeRowFocus=u.getFunction(viewModel,this.gridOptions.onBeforeRowFocus),this.gridOptions.onRowFocus=u.getFunction(viewModel,this.gridOptions.onRowFocus),this.gridOptions.onBeforeRowUnFocus=u.getFunction(viewModel,this.gridOptions.onBeforeRowUnFocus),this.gridOptions.onRowUnFocus=u.getFunction(viewModel,this.gridOptions.onRowUnFocus),this.gridOptions.onDblClickFun=u.getFunction(viewModel,this.gridOptions.onDblClickFun),this.gridOptions.onValueChange=u.getFunction(viewModel,this.gridOptions.onValueChange),this.gridOptions.onBeforeClickFun=u.getFunction(viewModel,this.gridOptions.onBeforeClickFun),this.gridOptions.onBeforeEditFun=u.getFunction(viewModel,this.gridOptions.onBeforeEditFun),this.gridOptions.onRowHover=u.getFunction(viewModel,this.gridOptions.onRowHover),this.gridOptions.afterCreate=u.getFunction(viewModel,this.gridOptions.afterCreate);var customOnBeforeEditFun=this.gridOptions.onBeforeEditFun,newOnBeforeEditFun=function(t){var i=t.colIndex,e=t.$tr;return!($(e.find("td")[i]).find("[type=radio]").length>0||$(e.find("td")[i]).find("[type=checkbox]").length>0)&&("function"!=typeof customOnBeforeEditFun||customOnBeforeEditFun(t))};this.gridOptions.onBeforeEditFun=newOnBeforeEditFun;var columns=[];$("div",this.$element).each(function(){var ops=$(this).attr("options");if("undefined"==typeof ops)var column=eval("("+ops+")");else var column=JSON.parse(ops);var eType=u.getFunction(viewModel,column.editType),rType=u.getFunction(viewModel,column.renderType),afterEType=u.getFunction(viewModel,column.afterEType),afterRType=u.getFunction(viewModel,column.afterRType),sumRenderType=u.getFunction(viewModel,column.sumRenderType);column.sumRenderType=sumRenderType;var eOptions={};if(column.editOptions)if("undefined"==typeof column.editOptions)var eOptions=eval("("+column.editOptions+")");else var eOptions=column.editOptions;eOptions.data=options.data,eOptions.field=column.field,""==eType&&(eType="string"),"string"==eType||"integer"==eType||"checkbox"==eType||"combo"==eType||"radio"==eType||"float"==eType||"currency"==eType||"datetime"==eType||"date"==eType||"time"==eType||"url"==eType||"password"==eType||"percent"==eType?(oThis.createDefaultEdit(eType,eOptions,options,viewModel,column),column.editType=function(t){oThis.editComponentDiv[column.field]&&oThis.editComponentDiv[column.field][0].childNodes.length>0||oThis.createDefaultEdit(eType,eOptions,options,viewModel,column);var i=oThis.editComponent[column.field];if(!i)return void $(t.element).parent().focus();t.element.innerHTML="";oThis.getDataTableRow(t.rowObj);$(t.element).append(oThis.editComponentDiv[column.field]),i.required&&$(t.element).parent().parent().find(".u-grid-edit-mustFlag").show(),$(t.element).parent().focus(),i.modelValueChange(t.value),"function"==typeof afterEType&&afterEType.call(this,t)}):"function"==typeof eType&&(column.editType=eType),"booleanRender"==rType?column.renderType=function(t){var i="";"Y"==t.value&&(i="checked");var e='<input type="checkbox"   style="cursor:default;" '+i+">";t.element.innerHTML=e;var o=t.gridObj,n=o.dataTable,s=t.row.value["$_#_@_id"],r=n.getRowByRowId(s);$(t.element).find("input").on("click",function(){var i=this.checked?"Y":"N",e=t.gridCompColumn,o=e.options.field;r.setValue(o,i)}),"function"==typeof afterRType&&afterRType.call(this,t)}:"integerRender"==rType?column.renderType=function(t){var i=t.gridObj,e=t.gridCompColumn,o=e.options.field;t.element.innerHTML=t.value,$("#"+i.options.id+"_header_table").find('th[field="'+o+'"]').css("text-align","right"),$(t.element).css("text-align","right"),$(t.element).css("color","#e33c37"),$(t.element).find(".u-grid-header-link").css("padding-right","3em"),"function"==typeof afterRType&&afterRType.call(this,t)}:"currencyRender"==rType?column.renderType=function(t){var i=t.gridObj,e=t.gridCompColumn,o=e.options.field,n=t.rowIndex,s=i.dataTable,r=$(i.dataSourceObj.rows[n].value).attr("$_#_@_id"),d=s.getRowByRowId(r);if(d){var a=d.getMeta(o,"precision"),l=iweb.Core.getMaskerMeta("float")||{},h="number"==typeof parseFloat(a)?a:l.precision;l.precision=h,l.precision=h||l.precision;var c=new u.NumberFormater(l.precision),p=new u.NumberMasker(l),f=p.format(c.format(t.value)).value;t.element.innerHTML=f,$("#"+i.options.id+"_header_table").find('th[field="'+o+'"]').css("text-align","right"),$(t.element).css("text-align","right"),$(t.element).css("color","#e33c37"),$(t.element).find(".u-grid-header-link").css("padding-right","3em"),$(t.element).attr("title",f),"function"==typeof afterRType&&afterRType.call(this,t)}}:"floatRender"==rType?column.renderType=function(t){var i=t.gridObj,e=t.gridCompColumn,o=e.options.field,n=t.rowIndex,s=i.dataTable,r=$(i.dataSourceObj.rows[n].value).attr("$_#_@_id"),d=s.getRowByRowId(r);if(d){var a=d.getMeta(o,"precision")||e.options.precision,l=iweb.Core.getMaskerMeta("float")||{},h="number"==typeof parseFloat(a)?a:l.precision;l.precision=h;var c=new u.NumberFormater(l.precision),p=new u.NumberMasker(l),f=p.format(c.format(t.value)).value;t.element.innerHTML=f,$("#"+i.options.id+"_header_table").find('th[field="'+o+'"]').css("text-align","right"),$(t.element).css("text-align","right"),$(t.element).css("color","#e33c37"),$(t.element).find(".u-grid-header-link").css("padding-right","3em"),$(t.element).attr("title",f),"function"==typeof afterRType&&afterRType.call(this,t)}}:"comboRender"==rType?column.renderType=function(t){var i=u.getJSObject(viewModel,eOptions.datasource);t.element.innerHTML="",o&&(o.length=0);for(var e=t.value.split(","),o=[],n=0,s=i.length;n<s;n++)for(var r=0;r<e.length;r++)i[n].value==e[r]&&o.push(i[n].name);var d=o.toString();d||(d=t.value),t.element.innerHTML=d,$(t.element).attr("title",d),"function"==typeof afterRType&&afterRType.call(this,t)}:"dateRender"==rType?column.renderType=function(t){var i=u.dateRender(t.value,t.gridCompColumn.options.format);t.element.innerHTML=i,$(t.element).attr("title",i),"function"==typeof afterRType&&afterRType.call(this,t)}:"dateTimeRender"==rType?column.renderType=function(t){var i=u.dateTimeRender(t.value);t.element.innerHTML=i,$(t.element).attr("title",i),"function"==typeof afterRType&&afterRType.call(this,t)}:"function"==typeof rType?column.renderType=rType:"radioRender"==rType?column.renderType=function(t){var i=u.getJSObject(viewModel,eOptions.datasource),e=t.value,o=$('<div class="u-grid-edit-item-radio"></div>');t.element.innerHTML="",$(t.element).append(o);for(var n=0;n<i.length;n++)i[n].value==e?o.append('<input name="'+column.field+t.row.value["$_#_@_id"]+'" type="radio" value="'+i[n].value+'" checked="true" /><i data-role="name">'+i[n].name+"</i>"):o.append('<input name="'+column.field+t.row.value["$_#_@_id"]+'" type="radio" value="'+i[n].value+'"/><i data-role="name">'+i[n].name+"</i>");o.find(":radio").each(function(){$(this).on("click",function(){var i=this.value;o.find(":radio").each(function(){this.value==i?this.checked=!0:this.checked=!1});var e=t.gridObj,n=t.gridCompColumn,s=n.options.field,r=e.dataTable,d=t.row.value["$_#_@_id"],a=r.getRowByRowId(d);a.setValue(s,i)})}),"function"==typeof afterRType&&afterRType.call(this,obj)}:"urlRender"==rType?column.renderType=function(t){t.element.innerHTML='<a href="'+t.value+'" target="_blank">'+t.value+"</a>","function"==typeof afterRType&&afterRType.call(this,t)}:"passwordRender"==rType?column.renderType=function(t){t.element.innerHTML='<input type="password" disable="true" role="grid-for-edit" readonly="readonly" style="border:0px;background:none;padding:0px;" value="'+t.value+'" title=""><span class="uf uf-eyeopen right-span" role="grid-for-edit"></span>';var i=t.element.querySelector("span"),e=t.element.querySelector("input");e.value=t.value,$(i).on("click",function(){"password"==e.type?e.type="text":e.type="password"}),"function"==typeof afterRType&&afterRType.call(this,t)}:"percentRender"==rType&&(column.renderType=function(t){var i=t.gridObj,e=t.gridCompColumn,o=e.options.field,n=t.rowIndex,s=i.dataTable,r=$(i.dataSourceObj.rows[n].value).attr("$_#_@_id"),d=s.getRowByRowId(r);if(d){var a=d.getMeta(o,"precision")||e.options.precision,l=iweb.Core.getMaskerMeta("percent")||{},h="number"==typeof parseFloat(a)?a:l.precision;l.precision=h,l.precision&&(l.precision=parseInt(l.precision)+2);var c=new u.NumberFormater(l.precision),p=new u.PercentMasker(l),f=p.format(c.format(t.value)).value;t.element.innerHTML=f,$(t.element).css("text-align","right"),$(t.element).attr("title",f),"function"==typeof afterRType&&afterRType.call(this,t)}});var defineSumRenderType=column.sumRenderType;column.sumRenderType=function(t){t.value=parseFloat(t.value);var i=t.gridObj,e=t.gridCompColumn,o=e.options.precision,n=iweb.Core.getMaskerMeta("float")||{},s=0==o||o&&"number"==typeof parseFloat(o)?o:n.precision;n.precision=s;var r=new u.NumberFormater(n.precision),d=new u.NumberMasker(n),a=d.format(r.format(t.value)).value;t.element.innerHTML=a,$(t.element).parent().css("text-align","right"),$(t.element).css("text-align","right"),$(t.element).attr("title",a),"function"==typeof defineSumRenderType&&defineSumRenderType.call(i,t)},columns.push(column)}),app&&app.adjustFunc&&app.adjustFunc.call(app,{id:this.id,type:"gridColumn",columns:columns}),this.gridOptions.columns=columns;var onRowSelectedFun=this.gridOptions.onRowSelected;this.gridOptions.onRowSelected=function(t){var i=oThis.grid.dataSourceObj.rows[t.rowIndex].value["$_#_@_id"],e=oThis.dataTable.getIndexByRowId(i);oThis.grid.options.multiSelect?oThis.dataTable.addRowsSelect([e]):oThis.dataTable.setRowSelect(e),onRowSelectedFun&&onRowSelectedFun.call(oThis,t)},this.dataTable.on(u.DataTable.ON_ROW_SELECT,function(t){$.each(t.rowIds,function(){var t=oThis.grid.getRowIndexByValue("$_#_@_id",this),i=!0;t>-1&&(i=oThis.grid.setRowSelect(parseInt(t)),i||oThis.dataTable.setRowUnSelect(oThis.dataTable.getIndexByRowId(this)))})}),this.dataTable.on(u.DataTable.ON_ROW_ALLSELECT,function(t){oThis.grid.setAllRowSelect()}),this.dataTable.on(u.DataTable.ON_ROW_ALLUNSELECT,function(t){oThis.grid.setAllRowUnSelect()});var onRowUnSelectedFun=this.gridOptions.onRowUnSelected;this.gridOptions.onRowUnSelected=function(t){var i=oThis.grid.dataSourceObj.rows[t.rowIndex].value["$_#_@_id"],e=oThis.dataTable.getIndexByRowId(i);oThis.dataTable.setRowUnSelect(e),onRowUnSelectedFun&&onRowUnSelectedFun.call(oThis,t)},this.dataTable.on(u.DataTable.ON_ROW_UNSELECT,function(t){$.each(t.rowIds,function(){var t=oThis.grid.getRowIndexByValue("$_#_@_id",this),i=!0;t>-1&&(i=oThis.grid.setRowUnselect(parseInt(t)),i||(oThis.grid.options.multiSelect?oThis.dataTable.addRowsSelect([oThis.dataTable.getIndexByRowId(this)]):oThis.dataTable.setRowSelect(oThis.dataTable.getIndexByRowId(this))))})});var onRowFocusFun=this.gridOptions.onRowFocus;this.gridOptions.onRowFocus=function(t){var i=oThis.grid.dataSourceObj.rows[t.rowIndex].value["$_#_@_id"],e=oThis.dataTable.getIndexByRowId(i);oThis.grid.options.rowClickBan?oThis.dataTable.setRowFocus(e,!0):oThis.dataTable.setRowFocus(e),onRowFocusFun&&onRowFocusFun.call(oThis,t)},this.dataTable.on(u.DataTable.ON_ROW_FOCUS,function(t){var i=oThis.grid.getRowIndexByValue("$_#_@_id",t.rowId),e=!0;i>-1&&(e=oThis.grid.setRowFocus(parseInt(i)),e||oThis.dataTable.setRowUnFocus(oThis.dataTable.getIndexByRowId(t.rowId)))});var onRowUnFocusFun=this.gridOptions.onRowUnFocus;this.gridOptions.onRowUnFocus=function(t){var i=oThis.grid.dataSourceObj.rows[t.rowIndex].value["$_#_@_id"],e=oThis.dataTable.getIndexByRowId(i);oThis.dataTable.setRowUnFocus(e),onRowUnFocusFun&&onRowUnFocusFun.call(oThis,t)},this.dataTable.on(u.DataTable.ON_ROW_UNFOCUS,function(t){var i=oThis.grid.getRowIndexByValue("$_#_@_id",t.rowId),e=!0;i>-1&&(e=oThis.grid.setRowUnFocus(parseInt(i)),e||oThis.dataTable.setRowFocus(oThis.dataTable.getIndexByRowId(t.rowId)))}),this.dataTable.on(u.DataTable.ON_INSERT,function(t){var i=new Array;$.each(t.rows,function(){var t=this.data,e=this.rowId,o={};for(var n in t)o[n]=t[n].value;o["$_#_@_id"]=e,i.push(o)}),oThis.grid.addRows(i,t.index)}),this.dataTable.on(u.DataTable.ON_UPDATE,function(t){$.each(t.rows,function(){var t=this.data,i=this.rowId,e={};for(var o in t)e[o]=t[o].value;e["$_#_@_id"]=i;var n=oThis.grid.getRowIndexByValue("$_#_@_id",i);oThis.grid.updateRow(n,e)})}),this.dataTable.on(u.DataTable.ON_VALUE_CHANGE,function(t){var i=t.rowId,e=oThis.grid.getRowIndexByValue("$_#_@_id",i);if(e!=-1){var o=t.field,n=t.newValue;oThis.grid.updateValueAt(e,o,n)}}),this.dataTable.on(u.DataTable.ON_DELETE,function(t){var i=new Array;$.each(t.rowIds,function(){var t=oThis.grid.getRowIndexByValue("$_#_@_id",this);i.push(t)}),oThis.grid.deleteRows(i)}),this.dataTable.on(u.DataTable.ON_DELETE_ALL,function(t){oThis.grid.setDataSource({})});var onValueChangeFun=this.gridOptions.onValueChange;this.gridOptions.onValueChange=function(t){var i=oThis.getDataTableRow(oThis.grid.dataSourceObj.rows[t.rowIndex].value);i&&("object"==$.type(t.newValue)?(i.setValue(t.field,t.newValue.trueValue),i.setMeta(t.field,"display",t.newValue.showValue)):i.setValue(t.field,t.newValue)),onValueChangeFun&&onValueChangeFun.call(oThis,t)},this.dataTable.on("valueChange",function(t){var i=t.field,e=t.rowId,o=(t.oldValue,t.newValue),n=oThis.grid.getRowIndexByValue("$_#_@_id",e);n>-1&&oThis.grid.updateValueAt(n,i,o)}),this.dataTable.on(u.DataTable.ON_LOAD,function(t){if(t.length>0){var i=new Array;$.each(t,function(){var t={},e=this.data,o=this.rowId;for(var n in e){var s=e[n].value;t[n]=s}t["$_#_@_id"]=o,i.push(t)});var e={};e.values=i,oThis.grid.setDataSource(e)}}),this.dataTable.on(u.DataTable.ON_ENABLE_CHANGE,function(t){oThis.grid.setEditable(t.enable)}),this.dataTable.on(u.DataTable.ON_ROW_META_CHANGE,function(t){var i=t.field,e=t.meta,o=t.row,n=t.newValue;if("required"==e&&oThis.grid.setRequired(i,n),"precision"==e){var s=oThis.editComponent[i];s&&s.setPrecision(n);var r=oThis.grid.getRowIndexByValue("$_#_@_id",o.rowId);if(r==-1)return;var d=o.getValue(i);oThis.grid.updateValueAt(r,i,d,!0)}}),this.dataTable.on(u.DataTable.ON_META_CHANGE,function(t){var i=t.field,e=t.meta;"precision"==e&&oThis.grid.renderTypeFun({field:i})}),this.gridOptions.transMap={ml_show_column:trans("gridComp.show_column","显示/隐藏列"),ml_clear_set:trans("gridComp.clear_set","清除设置"),ml_no_rows:trans("gridComp.no_rows","无数据"),ml_sum:trans("gridComp.sum","合计:"),ml_close:trans("gridComp.close","关闭")},this.grid=$(element).grid(this.gridOptions),this.grid.dataTable=this.dataTable,this.grid.viewModel=viewModel,this.grid.gridModel=this;var data=this.dataTable.rows();if(data.length>0){var values=new Array;$.each(data,function(){var t={},i=this.data,e=this.rowId;for(var o in i){var n=i[o].value;t[o]=n}t["$_#_@_id"]=e,values.push(t)});var dataSource={};dataSource.values=values,oThis.grid.setDataSource(dataSource)}var selectIndexs=this.dataTable.getSelectedIndexs();return selectIndexs.length>0&&$.each(selectIndexs,function(){oThis.grid.setRowSelect(this)}),this},getName:function(){return"grid"},createDefaultEdit:function(t,i,e,o,n){var s=this;i.showFix=!0,"string"==t?(compDiv=$('<div><input type="text" class="u-grid-edit-item-string"></div>'),e.editType&&"default"!=e.editType||compDiv.addClass("eType-input"),i.dataType="string",comp=new u.StringAdapter({el:compDiv[0],options:i,model:o})):"integer"==t?(compDiv=$('<div><input type="text" class="u-grid-edit-item-integer"></div>'),e.editType&&"default"!=e.editType||compDiv.addClass("eType-input"),i.dataType="integer",comp=new u.IntegerAdapter({el:compDiv[0],options:i,model:o})):"checkbox"==t?(compDiv=$('<div><input id="'+s.id+"_edit_field_"+n.field+'" type="checkbox" class="u-grid-edit-item-checkbox"></div>'),$.CheckboxComp?comp=new $.CheckboxComp(compDiv.find("input")[0],i,o):comp=new u.CheckboxAdapter({el:compDiv[0],options:i,model:o})):"combo"==t?(compDiv=$('<div class="eType-input"><input type="text" class="u-grid-edit-item-float"></div>'),$.Combobox?(compDiv=$('<div class="input-group  form_date u-grid-edit-item-comb"><div  type="text" class="form-control grid-combox"></div><i class="input-group-addon" ><i class="uf uf-anglearrowdown"></i></i></div>'),comp=new $.Combobox(compDiv[0],i,o)):(comp=new u.ComboboxAdapter({el:compDiv[0],options:i,model:o}),s.gridOptions.customEditPanelClass?s.gridOptions.customEditPanelClass.indexOf("u-combo-ul")<0&&(s.gridOptions.customEditPanelClass+=",u-combo-ul"):s.gridOptions.customEditPanelClass="u-combo-ul")):"radio"==t?e.editType&&"default"!=e.editType?(compDiv=$('<div class="u-grid-edit-item-radio"><input type="radio" name="identity" /><i data-role="name"></i></div>'),comp=new u.RadioAdapter({el:compDiv[0],options:i,model:o})):(compDiv=null,comp=null):"float"==t?(compDiv=$('<div><input type="text" class="u-grid-edit-item-float"></div>'),e.editType&&"default"!=e.editType||compDiv.addClass("eType-input"),i.dataType="float",comp=new u.FloatAdapter({el:compDiv[0],options:i,model:o})):"currency"==t?(compDiv=$('<div><input type="text" class="u-grid-edit-item-currency"></div>'),e.editType&&"default"!=e.editType||compDiv.addClass("eType-input"),i.dataType="currency",comp=new u.CurrencyAdapter({el:compDiv[0],options:i,model:o})):"datetime"==t?(compDiv=$('<div class="input-group u-grid-edit-item-datetime" ><input class="form-control" /><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span></div>'),$.DateTime?comp=new $.DateTime(compDiv[0],i,o):(comp=new u.DateTimeAdapter({el:compDiv[0],options:i,model:o}),s.gridOptions.customEditPanelClass?s.gridOptions.customEditPanelClass.indexOf("u-date-panel")<0&&(s.gridOptions.customEditPanelClass+=",u-date-panel"):s.gridOptions.customEditPanelClass="u-date-panel")):"date"==t?(compDiv=$('<div class="input-group u-grid-edit-item-date" ><input class="form-control" /><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span></div>'),$.DateComp?comp=new $.DateComp(compDiv[0],i,o):(i.type="u-date",comp=new u.DateTimeAdapter({el:compDiv[0],options:i,model:o}),s.gridOptions.customEditPanelClass?s.gridOptions.customEditPanelClass.indexOf("u-date-panel")<0&&(s.gridOptions.customEditPanelClass+=",u-date-panel"):s.gridOptions.customEditPanelClass="u-date-panel")):"url"==t?(compDiv=$('<div><input type="text" class="u-grid-edit-item-string"></div>'),e.editType&&"default"!=e.editType||compDiv.addClass("eType-input"),i.dataType="url",comp=new u.UrlAdapter({el:compDiv[0],options:i,model:o})):"password"==t?(compDiv=$('<div><input type="text" class="u-grid-edit-item-string"><span class="uf uf-eyeopen right-span"></span></div>'),e.editType&&"default"!=e.editType||compDiv.addClass("eType-input"),i.dataType="password",comp=new u.PassWordAdapter({el:compDiv[0],options:i,model:o})):"percent"==t&&(compDiv=$('<div><input type="text" class="u-grid-edit-item-float"></div>'),e.editType&&"default"!=e.editType||compDiv.addClass("eType-input"),i.dataType="precent",comp=new u.PercentAdapter({el:compDiv[0],options:i,model:o})),$("input",$(compDiv)).on("keydown",function(t){t.keyCode;13!=t.keyCode&&9!=t.keyCode||(this.blur(),s.grid.nextEditShow(),u.stopEvent(t))}),comp&&comp.dataAdapter&&(comp=comp.dataAdapter),s.editComponentDiv[n.field]=compDiv,s.editComponent[n.field]=comp},getDataTableRow:function(t){var i=t["$_#_@_id"],e=null,o=this.dataTable.getIndexByRowId(i);return o>-1&&(e=this.dataTable.getRow(o)),e},setEnable:function(t){this.grid.setEditable(t)},setShowHeader:function(t){this.grid.setShowHeader(t)},editRowFun:function(t){this.dataTable.setRowSelect(t),this.grid.editRowIndexFun(t)},doValidate:function(options){for(var rows=this.grid.dataSourceObj.rows,gridColumnArr=this.grid.gridCompColumnArr,passed=!0,MsgArr=new Array,evalStr="",rowMsg="",wholeMsg="",columnShowMsg="",j=0;j<gridColumnArr.length;j++){var column=gridColumnArr[j],columnOptions=gridColumnArr[j].options,field=columnOptions.field,title=columnOptions.title,required=columnOptions.required,validType,placement,tipId,errorMsg,nullMsg,maxLength,minLength,max,min,maxNotEq,minNotEq,reg;columnOptions.editOptions&&(validType=columnOptions.editOptions.validType||"",placement=columnOptions.editOptions.placement||"",tipId=columnOptions.editOptions.tipId||"",errorMsg=columnOptions.editOptions.errorMsg||"",nullMsg=columnOptions.editOptions.nullMsg||"",maxLength=columnOptions.editOptions.maxLength||"",minLength=columnOptions.editOptions.minLength||"",max=columnOptions.editOptions.max||"",min=columnOptions.editOptions.min||"",maxNotEq=columnOptions.editOptions.maxNotEq||"",minNotEq=columnOptions.editOptions.minNotEq||"",reg=columnOptions.editOptions.regExp||"");for(var columnPassedFlag=!0,columnMsg="",validate=new u.Validate({el:this.element,single:!0,required:required,validType:validType,placement:placement,tipId:tipId,errorMsg:errorMsg,nullMsg:nullMsg,maxLength:maxLength,minLength:minLength,max:max,min:min,maxNotEq:maxNotEq,minNotEq:minNotEq,reg:reg}),i=0;i<rows.length;i++){var value=rows[i].value[field],result=validate.check({pValue:value,showMsg:!1});if(passed=result.passed&&passed,!result.passed){columnPassedFlag=!1,options.showMsg&&columnMsg.indexOf(result.Msg)<0&&(columnMsg+=result.Msg+" ");var index=this.grid.getIndexOfColumn(column),contentDiv=document.getElementById(this.grid.options.id+"_content_tbody"),row=contentDiv.querySelectorAll("tr")[i],td=row.querySelectorAll("td")[index],div=td.querySelector("div");u.addClass(td,"u-grid-err-td"),u.addClass(div,"u-grid-err-td"),evalStr="if(typeof obj"+i+" == 'undefined'){var obj"+i+"= {}; MsgArr.push(obj"+i+");obj"+i+".rowNum = "+i+"; obj"+i+".arr = new Array();}",eval(evalStr);var msg="("+title+")"+result.Msg+";";evalStr="obj"+i+".arr.push(msg)",eval(evalStr)}}!columnPassedFlag&&options.showMsg&&(columnShowMsg+=title+":"+columnMsg+"<br>")}columnShowMsg&&u.showMessage({msg:columnShowMsg,showSeconds:3}),MsgArr.length>0&&MsgArr.sort(function(t,i){return t.rowNum>i.rowNum?1:-1});for(var k=0;k<MsgArr.length;k++){var rowNum=MsgArr[k].rowNum;rowMsg=MsgArr[k].arr.join(""),wholeMsg+="第"+(rowNum+1)+"行:"+rowMsg}return{passed:passed,comp:this,Msg:wholeMsg}}}),u.compMgr.addDataAdapter({adapter:u.GridAdapter,name:"grid"});