From 69420539b458a3f32716f51aab6d397423313fd9 Mon Sep 17 00:00:00 2001 From: Thomas Jang Date: Fri, 14 Oct 2016 16:40:14 +0900 Subject: [PATCH] =?UTF-8?q?AXGrid@4.6.8=20=EA=B7=B8=EB=A6=AC=EB=93=9C=20?= =?UTF-8?q?=EB=AA=A8=EB=B0=94=EC=9D=BC=20=EB=B7=B0=EB=AA=A8=EB=93=9C=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=20=EB=B2=84=EA=B7=B8=20=ED=94=BD?= =?UTF-8?q?=EC=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/AXJ.all.js | 22 ++++++++++++++-------- dist/AXJ.min.js | 2 +- dist/AXJ.tiny.js | 4 ++-- lib/AXGrid.js | 20 +++++++++++++------- lib/AXJ.js | 2 +- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/dist/AXJ.all.js b/dist/AXJ.all.js index 2da975c0..8a1ee39a 100644 --- a/dist/AXJ.all.js +++ b/dist/AXJ.all.js @@ -1,8 +1,8 @@ /*! -axisj - v1.1.9 - 2016-08-25 +axisj - v1.1.10 - 2016-10-14 */ /*! -axisj - v1.1.9 - 2016-08-25 +axisj - v1.1.10 - 2016-10-14 */ if(!window.AXConfig){ @@ -18204,8 +18204,8 @@ var AXGrid = Class.create(AXJ, { } po.push(''}return result},getTooltipValue:function(formatter,item,itemIndex,value,key,CH){var result,cfg=this.config;if("money"==formatter)result=""==value||"null"==value?"0":value.number().money();else if("dec"==formatter)result=void 0==value?"":value.dec();else if("html"==formatter)result=value;else if("checkbox"==formatter||"radio"==formatter){var checked="";if(CH.checked){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page,key:key,value:value},callResult=CH.checked.call(sendObj);callResult&&(checked=' checked="checked" ')}result='"}else if(Object.isFunction(formatter)){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page,key:key,value:value};result=formatter.call(sendObj,itemIndex,item)}else result=value;return result},getAddingClass:function(formatter,item,itemIndex,value,key,CH){var result=(this.config,"");if(Object.isString(formatter))result=formatter;else if(Object.isFunction(formatter)){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page,key:key,value:value};result=formatter.call(sendObj,itemIndex,item)}return result},getItem:function(itemIndex,item,isfix,hasTr){if(!item)return"";var cfg=this.config,tpo=[],evenClassName="line"+itemIndex%2,getFormatterValue=this.getFormatterValue.bind(this),getTooltipValue=this.getTooltipValue.bind(this),getAddingClass=this.getAddingClass.bind(this),hasFixed=this.hasFixed,hasTrValue=void 0===hasTr,trAddClass="",lastTdRowspan="";if(cfg.body.addClass)try{trAddClass=cfg.body.addClass.call({index:itemIndex,item:item,list:this.list,page:this.page})||""}catch(e){console.log(e)}for(var r=0,l=cfg.body.rows.length;l>r;r++){var trHeight=0;trHeight=this.cachedDom.tbody.find("#"+cfg.targetID+"_AX_tr_"+r+"_AX_n_AX_"+itemIndex+" td").innerHeight(),hasTrValue&&("fix"==isfix?tpo.push(''):tpo.push(''));var CH,CG,colCount=0,CHidx=0;for(cfg.body.rows[r].length;CHidx0){var printOk=!1,makeBodyNode=!0;if("n"==isfix&&(printOk=!0,"undefined"==typeof CH.colSeq||"undefined"!=typeof cfg.fixedColSeq&&cfg.fixedColSeq>0&&CH.colSeq1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"";lastTdRowspan=rowspan;var valign=' valign="'+CH.valign+'" ',bottomClass=CH.isLastCell?"":" bodyBottomBorder",fixedClass=CH.isFixedEndCell?" fixedLine":"",styles=' style="vertical-align:'+CH.valign+';"',tdHeight=function(){if(cfg.body.heights&&cfg.body.heights[r]){for(var tdHeight=0,i=r;i1&&(styles=' style="vertical-align:'+CH.valign+";height:"+trHeight+'px;"');var bodyNodeClass="";"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml");var tooltipValue="";CH.tooltip&&(tooltipValue=getTooltipValue(CH.tooltip,item,itemIndex,item[CH.key],CH.key,CH));var addClasses="";CH.addClass&&(addClasses=" "+getAddingClass(CH.addClass,item,itemIndex,item[CH.key],CH.key,CH));var tdEndStyles="";CH.isTdEnd&&cfg.hiddenBorder_tdLastChild&&(tdEndStyles="background-image:none;"),tpo.push("'),makeBodyNode&&(tpo.push('
'),hasFixed&&!CH.isFixedCell||!hasFixed||void 0!=isfix?CH.formatter?tpo.push(getFormatterValue(CH.formatter,item,itemIndex,item[CH.key],CH.key,CH,CHidx)):CH.editor&&("checkbox"==CH.editor.type||"radio"==CH.editor.type||CH.editor.type in this.formatter)?tpo.push(getFormatterValue("",item,itemIndex,item[CG.key],CH.key,CH,CHidx)):tpo.push("null"==String(item[CH.key])?"":item[CH.key]):tpo.push(" "),tpo.push("
")),tpo.push("")}}0==r&&"n"==isfix&&tpo.push("
 
'),hasTrValue&&tpo.push("")}return tpo.join("")},getIconItem:function(itemIndex,item,viewIconObj,cssObj){var format,cfg=this.config,tpo=[];this.getFormatterValue.bind(this),this.getTooltipValue.bind(this);try{format=viewIconObj.format.call({index:itemIndex,item:item})}catch(e){console.log(e)}if(tpo.push('
'),format.imgsrc&&(tpo.push(''+format.label+'')),format.label&&(tpo.push('
'),tpo.push(format.label),tpo.push("
")),format.description&&(tpo.push('
'),tpo.push(format.description),tpo.push("
")),viewIconObj.buttons&&viewIconObj.buttons.items){tpo.push('
');for(var B,bidx=0;bidx'),tpo.push(B.label),tpo.push(" ");tpo.push("
")}return tpo.push("
"),tpo.join("")},getMobileItem:function(itemIndex,item,mobileView){var cfg=this.config,tpo=[],evenClassName="line"+itemIndex%2,getFormatterValue=this.getFormatterValue.bind(this),trAddClass=(this.getTooltipValue.bind(this),"");if(cfg.body.addClass)try{trAddClass=cfg.body.addClass.call({index:itemIndex,item:item,list:this.list,page:this.page})||""}catch(e){console.log(e)}tpo.push('
');for(var CN,__memoCol=null,displayColumnCount=0,cidx=0,__arr=mobileView.column;cidx<__arr.length&&(CN=__arr[cidx]);cidx++)1!=CN.display&&void 0!=CN.display||displayColumnCount++;for(var CN,cidx=0,__arr=mobileView.column;cidx<__arr.length&&(CN=__arr[cidx]);cidx++)if(1==CN.display||void 0==CN.display){var colClass="",colAddClass=CN.addClass||"";if(1===displayColumnCount&&(colAddClass=""),colClass=CN.col?"col"+CN.col:"colNone",null==__memoCol||CN.col||tpo.push("
"),tpo.push("
"),0!=mobileView.label?(tpo.push(""+CN.label+""),tpo.push("")):tpo.push(""),CN.formatter){for(var colSeq=0;colSeq"),tpo.push("
"),__memoCol=CN.col}if(tpo.push("
"),tpo.push("
"),mobileView.buttons)for(var B,bidx=0,__arr=mobileView.buttons;bidx<__arr.length&&(B=__arr[bidx]);bidx++)tpo.push(""),tpo.push("");return tpo.push("
"),tpo.push("
"),tpo.join("")},getItemMarker:function(itemIndex,item,isfix,markerIndexs){for(var cfg=this.config,tpo=[],evenClassName="gridBodyMarker",getFormatterValue=this.getFormatterValue.bind(this),hasFixed=this.hasFixed,trAddClass="",mi=0,l=markerIndexs.length;l>mi;mi++){var marker=cfg.body.marker[markerIndexs[mi]];if(marker.addClass)try{trAddClass=marker.addClass.call({index:itemIndex,item:item,list:this.list,page:this.page})||""}catch(e){console.log(e)}for(var r=0;r');for(var CH,colCount=0,CHidx=0,__arr=marker.rows[r];CHidx<__arr.length&&(CH=__arr[CHidx]);CHidx++)if(CH.display&&CH.colspan>0&&("n"==isfix||void 0!=isfix&&colCount1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bottomClass=CH.isLastCell?"":" bodyBottomBorder",fixedClass=CH.isFixedEndCell?" fixedLine":"",bodyNodeClass="";"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push("'),tpo.push('
'),hasFixed&&!CH.isFixedCell||!hasFixed||void 0!=isfix?CH.formatter?tpo.push(getFormatterValue(CH.formatter,item,itemIndex,item[CH.key],CH.key,CH)):tpo.push(item[CH.key]):tpo.push(" "),tpo.push("
"),tpo.push("")}0==r&&"n"==isfix&&tpo.push('
 
'),tpo.push("")}}return tpo.join("")},getMarkerDisplay:function(itemIndex,item){var cfg=this.config,bodyHasMarker=this.bodyHasMarker;if(!bodyHasMarker)return[];var sendObj={index:itemIndex,list:this.list,item:item,page:this.page},markerDisplay=[];try{for(var marker,m=0,l=cfg.body.marker.length;l>m;m++)marker=cfg.body.marker[m],marker.display.call(sendObj,itemIndex,item)&&markerDisplay.push(m)}catch(e){console.log(e)}return markerDisplay},printList:function(args){args||(args={});var markerIndex,cfg=this.config,bodyHasMarker=this.bodyHasMarker,getItem=this.getItem.bind(this),getItemMarker=this.getItemMarker.bind(this),getMarkerDisplay=this.getMarkerDisplay.bind(this);this.editorOpend&&this.cancelEditor();var getIconItem=this.getIconItem.bind(this),getMobileItem=this.getMobileItem.bind(this),po=[];if("grid"==cfg.viewMode){if("auto"==cfg.__height)for(var item,itemIndex=0,__arr=this.list;itemIndex<__arr.length&&(item=__arr[itemIndex]);itemIndex++)po.push(getItem(itemIndex,item,"n")),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getItemMarker(itemIndex,item,"n",markerIndex));else if(this.list.length>0){var firstItem=this.list[0];po.push(getItem(0,firstItem,"n"))}if(0==this.list.length&&(po.push(''),po.push(''),po.push('
'),po.push('
'),po.push(cfg.emptyListMSG),po.push("
"),po.push("
"),po.push(""),po.push('
 
'),po.push("")),this.cachedDom.tbody.empty(),this.cachedDom.tbody.append(po.join("")),this.hasFixed){if(po=[],"auto"==cfg.__height)for(var item,itemIndex=0,__arr=this.list;itemIndex<__arr.length&&(item=__arr[itemIndex]);itemIndex++)po.push(getItem(itemIndex,item,"fix")),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getItemMarker(itemIndex,item,"fix",markerIndex));else this.list.length>0&&po.push(getItem(0,firstItem,"fix"));this.cachedDom.fixed_tbody.empty(),this.cachedDom.fixed_tbody.append(po.join("")),0==this.list.length?this.fixedScrollContent.hide():this.fixedScrollContent.show()}if("auto"!=cfg.__height&&this.list.length>0){var itemTrHeight,printListCount,$itemTr=this.cachedDom.tbody.find("#"+cfg.targetID+"_AX_null_AX_0");if(!$itemTr.get(0))return;itemTrHeight=$itemTr.outerHeight().number(),this.scrollContent.css({"padding-bottom":itemTrHeight}),po=[],printListCount=(this.body.height()/itemTrHeight).ceil(),this.list.length>printListCount+cfg.listCountMargin?printListCount+=cfg.listCountMargin:printListCount=this.list.length;for(var item,itemIndex=0,__arr=this.list;printListCount>itemIndex&&(item=__arr[itemIndex]);itemIndex++)po.push(getItem(itemIndex,item,"n")),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getItemMarker(itemIndex,item,"n",markerIndex));if(this.cachedDom.tbody.empty(),this.cachedDom.tbody.append(po.join("")),this.hasFixed){po=[];for(var item,itemIndex=0,__arr=this.list;printListCount>itemIndex&&(item=__arr[itemIndex]);itemIndex++)po.push(getItem(itemIndex,item,"fix")),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getItemMarker(itemIndex,item,"fix",markerIndex));this.cachedDom.fixed_tbody.empty(),this.cachedDom.fixed_tbody.append(po.join(""))}this.virtualScroll={startIndex:0,endIndex:printListCount-1,itemTrHeight:itemTrHeight,printListCount:printListCount,scrollTop:0},cfg.mergeCells&&(this.mergeCells(this.cachedDom.tbody,"n"),this.hasFixed&&this.mergeCells(this.cachedDom.fixed_tbody,"f")),this.cachedDom.thpadding.css({height:0}),this.cachedDom.tfpadding.css({height:cfg.scrollContentBottomMargin.number()+(this.list.length-printListCount)*itemTrHeight}),this.hasFixed&&(this.cachedDom.fthpadding.css({height:0}),this.cachedDom.ftfpadding.css({height:cfg.scrollContentBottomMargin.number()+(this.list.length-printListCount)*itemTrHeight})),this.scrollContent.css({top:0}),this.contentScrollContentSync({top:0})}else"auto"==cfg.__height&&this.list.length>0?(this.virtualScroll={startIndex:0,endIndex:this.list.length,itemTrHeight:this.cachedDom.tbody.find("#"+cfg.targetID+"_AX_null_AX_0").outerHeight().number(),printListCount:this.list.length,scrollTop:0},cfg.foot?(this.cachedDom.thpadding.css({height:0}),this.cachedDom.tfpadding.css({height:cfg.scrollContentBottomMargin.number()}),this.hasFixed&&(this.cachedDom.fthpadding.css({height:0}),this.cachedDom.ftfpadding.css({height:cfg.scrollContentBottomMargin.number()}))):(this.cachedDom.thpadding.css({height:0}),this.cachedDom.tfpadding.css({height:cfg.scrollContentBottomMargin.number()}),this.hasFixed&&(this.cachedDom.fthpadding.css({height:0}),this.cachedDom.ftfpadding.css({height:cfg.scrollContentBottomMargin.number()}))),cfg.mergeCells&&(this.mergeCells(this.cachedDom.tbody,"n"),this.hasFixed&&this.mergeCells(this.cachedDom.fixed_tbody,"f")),this.scrollContent.css({top:0}),this.contentScrollContentSync({top:0}),this.gridTargetSetSize()):(this.virtualScroll={startIndex:0,endIndex:0,itemTrHeight:0,printListCount:0,scrollTop:0},this.cachedDom.thpadding.css({height:0}),this.cachedDom.tfpadding.css({height:cfg.scrollContentBottomMargin.number()}),this.hasFixed&&(this.cachedDom.fthpadding.css({height:0}),this.cachedDom.ftfpadding.css({height:cfg.scrollContentBottomMargin.number()})),this.scrollContent.css({top:0}),this.contentScrollContentSync({top:0}));if(this.body.find(".gridBodyTr").bind("mouseover",this.gridBodyOver.bind(this)),this.body.find(".gridBodyTr").bind("mouseout",this.gridBodyOut.bind(this)),this.body.find(".gridBodyTr:not(.gridBodyMarker)").bind("click",this.gridBodyClick.bind(this)),this.needBindDBLClick()&&this.body.find(".gridBodyTr").bind("dblclick",this.gridBodyDBLClick.bind(this)),this.selectedRow&&this.selectedRow.length>0){for(var itemIndex=0,__arr=this.selectedRow;itemIndex<__arr.length;itemIndex++)this.body.find(".gridBodyTr_"+__arr[itemIndex]).addClass("selected");var itemIndex=this.selectedRow.last(),itemDom=this.body.find(".gridBodyTr_"+itemIndex);if(itemDom[0]){var trHeight,trTop=itemDom.position().top,bodyHeight=(this.scrollContent.height(),this.body.height()),$itemTr=this.cachedDom.tbody.find("#"+cfg.targetID+"_AX_null_AX_0");if(!$itemTr.get(0))return;if(trHeight=$itemTr.outerHeight().number(),trTop.number()+trHeight.number()>bodyHeight){var scrollTop=bodyHeight-(trTop.number()+itemTrHeight.number());this.scrollContent.css({top:scrollTop-cfg.listCountMargin}),this.contentScrollContentSync({top:scrollTop-cfg.listCountMargin},null,args.reload)}else if(0==trTop.number()){var scrollTop=0;this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop},null,args.reload)}this.bigDataSync("reload")}}if(cfg.body.onchangeScroll){var sendObj=axf.copyObject(this.virtualScroll);cfg.body.onchangeScroll.call(sendObj,sendObj)}}else if("icon"==cfg.viewMode){var viewIconObj=cfg.view,viewIconCss=[];viewIconCss.push("width:"+viewIconObj.width.number()+"px"),viewIconCss.push("height:"+viewIconObj.height.number()+"px"),viewIconObj.style&&viewIconCss.push(viewIconObj.style);var viewIconImgCss=[];viewIconImgCss.push("left:"+viewIconObj.img.left.number()+"px"),viewIconImgCss.push("top:"+viewIconObj.img.top.number()+"px"),viewIconImgCss.push("width:"+viewIconObj.img.width.number()+"px"),viewIconImgCss.push("height:"+viewIconObj.img.height.number()+"px"),viewIconObj.img.style&&viewIconImgCss.push(viewIconObj.img.style);var viewIconLabelCss=[];viewIconLabelCss.push("left:"+viewIconObj.label.left.number()+"px"),viewIconLabelCss.push("top:"+viewIconObj.label.top.number()+"px"),viewIconLabelCss.push("width:"+viewIconObj.label.width.number()+"px"),viewIconLabelCss.push("height:"+viewIconObj.label.height.number()+"px"),viewIconObj.label.style&&viewIconLabelCss.push(viewIconObj.label.style);var viewIconDescriptionCss=[];viewIconDescriptionCss.push("left:"+viewIconObj.description.left.number()+"px"),viewIconDescriptionCss.push("top:"+viewIconObj.description.top.number()+"px"),viewIconDescriptionCss.push("width:"+viewIconObj.description.width.number()+"px"),viewIconDescriptionCss.push("height:"+viewIconObj.description.height.number()+"px"),viewIconObj.description.style&&viewIconDescriptionCss.push(viewIconObj.description.style);var viewIconButtonsCss=[];viewIconObj.buttons&&(viewIconButtonsCss.push("left:"+viewIconObj.buttons.left.number()+"px"),viewIconButtonsCss.push("top:"+viewIconObj.buttons.top.number()+"px"),viewIconButtonsCss.push("width:"+viewIconObj.buttons.width.number()+"px"),viewIconButtonsCss.push("height:"+viewIconObj.buttons.height.number()+"px"),viewIconObj.buttons.style&&viewIconButtonsCss.push(viewIconObj.buttons.style));for(var item,cssObj={box:viewIconCss.join(";"),img:viewIconImgCss.join(";"),label:viewIconLabelCss.join(";"),description:viewIconDescriptionCss.join(";"),buttons:viewIconButtonsCss.join(";")},itemIndex=0,__arr=this.list;itemIndex<__arr.length&&(item=__arr[itemIndex]);itemIndex++)po.push(getIconItem(itemIndex,item,viewIconObj,cssObj));po.push("
");var gridBodyDiv=axdom("#"+cfg.targetID+"_AX_gridBodyDiv");if(gridBodyDiv.empty(),gridBodyDiv.append(po.join("")),this.body.find(".bodyViewIcon").bind("click",this.gridBodyClick.bind(this)),this.needBindDBLClick()&&this.body.find(".bodyViewIcon").bind("dblclick",this.gridBodyDBLClick.bind(this)),this.selectedRow&&this.selectedRow.length>0)for(var item,body=this.body,itemIndex=0,__arr=this.selectedRow;itemIndex<__arr.length&&(item=__arr[itemIndex]);itemIndex++)body.find(".bodyViewIcon_"+item).addClass("selected");var _list=this.list,iconButtonClick=function(event){var ids=event.target.id.split(/_AX_/g),itemIndex=ids[ids.length-2],buttonIndex=ids[ids.length-1];viewIconObj.buttons.items[buttonIndex].onclick&&viewIconObj.buttons.items[buttonIndex].onclick.call({index:itemIndex,list:_list,item:_list[itemIndex],buttonItem:viewIconObj.buttons.items[buttonIndex]})},iconButtonClickBind=iconButtonClick.bind(this);this.body.find(".bodyViewIcon .viewIconButtonsItem").bind("click",function(event){iconButtonClickBind(event)})}else if("mobile"==cfg.viewMode){var mobileView=cfg.view;if(void 0==mobileView){for(var CG,columns=[],cidx=0,__arr=cfg.colGroup;cidx<__arr.length&&(CG=__arr[cidx]);cidx++){var col=null,addClass="";CG.widthAstric||CG.width.number()>=200?(col=4,addClass="underLine"):CG.width.number()>=100?col=2:CG.width.number()>=40,columns.push({key:CG.key,label:CG.label,col:col,formatter:CG.formatter,addClass:addClass,sort:CG.sort||"",display:CG.display||!0})}columns=columns.sort(function(pItem,nItem){var v1=pItem.col,v2=nItem.col;return v2>v1?1:v1>v2?-1:v1==v2?0:void 0}),mobileView={labelView:!0,column:columns}}for(var item,itemIndex=0,__arr=this.list;itemIndex<__arr.length&&(item=__arr[itemIndex]);itemIndex++)po.push(getMobileItem(itemIndex,item,mobileView));if(0==this.list.length&&(po.push('
'),po.push(cfg.emptyListMSG),po.push("
")),axdom("#"+cfg.targetID+"_AX_gridBodyDiv").empty(),axdom("#"+cfg.targetID+"_AX_gridBodyDiv").append(po.join("")),this.body.find(".bodyViewMobile").bind("click",this.gridBodyClick.bind(this)),this.needBindDBLClick()&&this.body.find(".bodyViewMobile").bind("dblclick",this.gridBodyDBLClick.bind(this)),this.selectedRow&&this.selectedRow.length>0)for(var item,body=this.body,itemIndex=0,__arr=this.selectedRow;itemIndex<__arr.length&&(item=__arr[itemIndex]);itemIndex++)body.find(".bodyViewMobile_"+item).addClass("selected");var _list=this.list,mobileButtonClick=function(event){var ids=event.target.id.split(/_AX_/g),itemIndex=ids[ids.length-2],buttonIndex=ids[ids.length-1];mobileView.buttons[buttonIndex].onclick&&mobileView.buttons[buttonIndex].onclick.call({index:itemIndex,list:_list,item:_list[itemIndex],buttonItem:mobileView.buttons[buttonIndex]})};mobileButtonClick.bind(this);this.body.find(".bodyViewMobile").find(".buttonGroupItem").bind("click",function(event){mobileButtonClick(event)})}this.selectedCells.clear(),"undefined"==typeof args?this.contentScrollResize():"undefined"!=typeof args&&args.sort&&this.contentScrollResize(!1),this.contentScrollXAttr=null,this.contentScrollYAttr=null},updateList:function(itemIndex,item){var cfg=this.config;if(this.cancelEditor(),"C"==item._CUD);else{if("D"==item._CUD)return void toast.push("삭제된 아이템 입니다. 수정할 수 없습니다.");item._CUD="U"}this.list[itemIndex]=item;var npo=this.getItem(itemIndex,item,"n","notr");if(this.hasFixed)var fpo=this.getItem(itemIndex,item,"fix","notr");axdom("#"+cfg.targetID+"_AX_tbody").find(".gridBodyTr_"+itemIndex).html(npo),this.hasFixed&&axdom("#"+cfg.targetID+"_AX_fixedTbody").find(".gridBodyTr_"+itemIndex).html(fpo);var trAddClass="";if(cfg.body.addClass)try{trAddClass=cfg.body.addClass.call({index:itemIndex,item:item,list:this.list})||""}catch(e){console.log(e)}axdom("#"+cfg.targetID+"_AX_tbody").find(".gridBodyTr_"+itemIndex).addClass(trAddClass),this.hasFixed&&axdom("#"+cfg.targetID+"_AX_fixedTbody").find(".gridBodyTr_"+itemIndex).addClass(trAddClass),this.redrawDataSet()},pushList:function(pushItem,insertIndex){this.config;if(this.inline_edit)return setTimeout(function(){this.pushList(pushItem,insertIndex)}.bind(this),300),this;this.cancelEditor();var pushData=[];if(pushData=Object.isArray(pushItem)?pushItem:[pushItem],pushItem._CUD="C",null!=insertIndex&&"undefined"!=typeof insertIndex){insertIndex>this.list.length&&(insertIndex=this.list.length);for(var L,itemIndex=insertIndex,newList=[],listIndex=0,__arr=this.list;listIndex<__arr.length&&(L=__arr[listIndex]);listIndex++){if(listIndex==itemIndex)for(var li=0;liii;ii++)"undefined"==typeof this.list[ii].___checked&&(this.list[ii].___checked={}),this.list[ii].___checked[c]=!1;"undefined"==typeof this.list[itemIndex].___checked&&(this.list[itemIndex].___checked={}),this.list[itemIndex].___checked[c]=checkedValue;var sendObj=(event.target,event.target.checked,{index:itemIndex,target:event.target,checked:event.target.checked,r:r,c:c,list:this.list,item:item,page:this.page});try{cfg.body.oncheck&&cfg.body.oncheck.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}else{var myTarget=axf.get_event_target(eventTarget,function(el){var edom=axdom(el);return!edom.hasClass("buttonGroupItem")&&(edom.hasClass("bodyTd")||edom.hasClass("bodyViewIcon")||edom.hasClass("bodyViewMobile"))});if("grid"==cfg.viewMode){if(myTarget){ var body=this.body,targetID=myTarget.id,itemIndex=targetID.split(/_AX_/g).last(),ids=targetID.split(/_AX_/g),len=this.selectedRow.length,_selectedRow=[],hasItem=!1,r=ids[ids.length-3],c=ids[ids.length-2],CG=cfg.colGroup[cfg.body.rowsEmpty?c:cfg.body.rows[r][c].colSeq||c],i=0;if(this._focusedItemIndex=itemIndex,this.editCellClear(r,c,itemIndex)===!1&&CG.editor)return this;if(event.shiftKey){if(this.selectedCells.length>0&&(axf.each(this.selectedCells,function(){body.find(".bodyTd_"+this).removeClass("selected")}),this.selectedCells.clear()),len>0){var st_index,ed_index,l_itemIndex=this.selectedRow.last().number(),itemIndex=itemIndex.number();itemIndex>l_itemIndex?(st_index=l_itemIndex+1,ed_index=itemIndex):(st_index=itemIndex,ed_index=l_itemIndex);for(var k=st_index;ed_index+1>k;k++){for(hasItem=!1,i=0;len>i;i++)if(k==this.selectedRow[i].number()){hasItem=!0;break}hasItem||(this.body.find(".gridBodyTr_"+k).addClass("selected"),this.selectedRow.push(k))}}else this.body.find(".gridBodyTr_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex.number());this.clearRange()}else if(event.metaKey||event.ctrlKey){for(this.selectedCells.length>0&&(axf.each(this.selectedCells,function(){body.find(".bodyTd_"+this).removeClass("selected")}),this.selectedCells.clear());len>i;i++)this.selectedRow[i]==itemIndex.number()?(body.find(".gridBodyTr_"+itemIndex).removeClass("selected"),hasItem=!0):_selectedRow.push(this.selectedRow[i]);this.selectedRow=_selectedRow,hasItem||(body.find(".gridBodyTr_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex.number())),this.clearRange()}else{if(this.selectedCells.length>0&&(axf.each(this.selectedCells,function(){body.find(".bodyTd_"+this).removeClass("selected")}),this.selectedCells.clear()),!CG.editor||"checkbox"!=CG.editor.type&&"radio"!=CG.editor.type&&"select"!=CG.editor.type&&"AXSelect"!=CG.editor.type){if(this.selectedRow.length>0){if(CG.editor&&cfg.control_lock_status<1){for(;len>i;i++)if(this.selectedRow[i]==itemIndex){hasItem=!0;break}hasItem&&this.editCell(r,c,itemIndex)}if(!hasItem)for(i=0;len>i;i++)body.find(".gridBodyTr_"+this.selectedRow[i]).removeClass("selected")}}else this.editCell(r,c,itemIndex,0,event);this.selectedRow.clear(),this.body.find(".gridBodyTr_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex.number()),cfg.mergeCells&&function(){for(var colGroupLen=0,nowTrTd=this.body.find(".gridBodyTable .gridBodyTr_"+itemIndex).find("td"),i=0,l=cfg.colGroup.length;l>i;i++)cfg.colGroup[i].display&&colGroupLen++;if(colGroupLen==nowTrTd.length-1){for(var i=0,l=nowTrTd.length;l>i;i++)if(nowTrTd[i].getAttribute("rowspan")>1){for(var ai=0;aii;i++)if(_nowTrTd[i].getAttribute("rowspan")>1){for(var ai=0;ai<_nowTrTd[i].getAttribute("rowspan");ai++)this.body.find(".gridBodyTr_"+(Number(parentItemIndex)+ai)).addClass("selected"),this.selectedRow.push(Number(parentItemIndex)+ai);break}finding=!1}safeLoop++,safeLoop>1e3&&(finding=!1)}while(finding)}}.call(this),this.body.find(".gridBodyTr_"+itemIndex).find(".bodyTd_"+c+".bodyTdr_"+r).addClass("selected"),this.selectedCells.push(c);var item=this.list[itemIndex];if(!hasItem&&cfg.body.onclick){var sendObj={index:itemIndex,r:r,c:c,list:this.list,item:item,page:this.page};try{cfg.body.onclick.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}}}}else if("icon"==cfg.viewMode){if(myTarget){var targetID=myTarget.id,itemIndex=targetID.split(/_AX_/g).last();if(this._focusedItemIndex=itemIndex,event.shiftKey);else if(!event.metaKey&&!event.ctrlKey){if(this.selectedRow.length>0){var body=this.body;axf.each(this.selectedRow,function(){body.find(".bodyViewIcon_"+this).removeClass("selected")})}this.selectedRow.clear(),this.body.find(".bodyViewIcon_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex);var item=this.list[itemIndex];if(cfg.body.onclick){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page};try{cfg.body.onclick.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}}}}else if("mobile"==cfg.viewMode&&myTarget){var targetID=myTarget.id,itemIndex=targetID.split(/_AX_/g).last();if(this._focusedItemIndex=itemIndex,event.shiftKey);else if(event.metaKey||event.ctrlKey);else{if(this.selectedRow.length>0){var body=this.body;axf.each(this.selectedRow,function(){body.find(".bodyViewMobile_"+this).removeClass("selected")})}this.selectedRow.clear(),this.body.find(".bodyViewMobile_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex);var item=this.list[itemIndex];if(cfg.body.onclick){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page};try{cfg.body.onclick.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}}}this.onevent_grid({type:"grid-list-click"})}},gridBodyDBLClick:function(event){var cfg=this.config,eventTarget=event.target;if("input"!=eventTarget.tagName.toLowerCase()&&"button"!=eventTarget.tagName.toLowerCase()){var myTarget=axf.get_event_target(eventTarget,function(el){var edom=axdom(el);return!edom.hasClass("buttonGroupItem")&&(edom.hasClass("bodyTd")||edom.hasClass("bodyViewIcon")||edom.hasClass("bodyViewMobile"))});if("grid"==cfg.viewMode){if(myTarget){var targetID=myTarget.id,itemIndex=targetID.split(/_AX_/g).last(),ids=targetID.split(/_AX_/g);if(this.selectedRow.length>0){var body=this.body;axf.each(this.selectedRow,function(){body.find(".gridBodyTr_"+this).removeClass("selected")})}if(this.selectedRow.clear(),this.body.find(".gridBodyTr_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex),cfg.body.ondblclick){var r=ids[ids.length-3],c=ids[ids.length-2],item=this.list[itemIndex],sendObj={index:itemIndex,r:r,c:c,list:this.list,item:item,page:this.page};try{cfg.body.ondblclick.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}}}else if("icon"==cfg.viewMode){if(myTarget){var targetID=myTarget.id,itemIndex=targetID.split(/_AX_/g).last();if(this.selectedRow.length>0){var body=this.body;axf.each(this.selectedRow,function(){body.find(".bodyViewIcon_"+this).removeClass("selected")})}if(this.selectedRow.clear(),this.body.find(".bodyViewIcon_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex),cfg.body.ondblclick){var item=this.list[itemIndex],sendObj={index:itemIndex,list:this.list,item:item,page:this.page};try{cfg.body.ondblclick.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}}}else if("mobile"==cfg.viewMode&&myTarget){var targetID=myTarget.id,itemIndex=targetID.split(/_AX_/g).last();if(this.selectedRow.length>0){var body=this.body;axf.each(this.selectedRow,function(){body.find(".bodyViewMobile_"+this).removeClass("selected")})}if(this.selectedRow.clear(),this.body.find(".bodyViewMobile_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex),cfg.body.ondblclick){var item=this.list[itemIndex],sendObj={index:itemIndex,list:this.list,item:item,page:this.page};try{cfg.body.ondblclick.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}}this.stopEvent(event),this.clearRange()}},editCell:function(r,c,ii,times,event){this.setFocus(ii);var get_editor,_this=this,cfg=this.config,CG=cfg.colGroup[cfg.body.rowsEmpty?c:cfg.body.rows[r][c].colSeq||c],po=[],that={item:this.list[ii],index:ii,CG:CG,r:r,c:c};if(CG.editor.disabled&&CG.editor.disabled.call(that))return this;if(CG.editor.createEdit===!1&&"C"==that.item._CUD)return this;if(CG.editor.updateEdit===!1&&"C"!=that.item._CUD)return this;var trackX=_this.scrollTrackX;if(trackX.is(":visible")){var _r=r,_c=c,colHeadRows=cfg.colHead.rows;if(colHeadRows.length>1){if(!this.config.colHead._headerRow){this.config.colHead._headerRow={};for(var i=0;i0&&2*trackXW>absEditHeaderLW?absEditHeaderLW>trackXW?(scrollSyncFlag=!0,_leftval=_this.scrollXHandle.position().left+(absEditHeaderLW-trackXW)/(_this.colHead.width()/trackXW),_leftval+=10):selColHeader.width()>absEditHeaderLW&&(scrollSyncFlag=!0,_leftval=_this.scrollXHandle.position().left-(selColHeader.width()-absEditHeaderLW)/(_this.colHead.width()/trackXW),_leftval-=10):(scrollSyncFlag=!0,_leftval=editHeaderLW/(_this.colHead.width()/trackXW)-scrollXW/2),scrollSyncFlag&&(_leftval=0>_leftval?0:_leftval>trackXW-scrollXW?trackXW-scrollXW:_leftval,_this.contentScrollScrollSync({left:_leftval}),_this.scrollXHandle.css("left",_leftval+"px"))}if(this.editCellClear(),"checkbox"==CG.editor.type||"radio"==CG.editor.type){if("radio"==CG.editor.type)for(var _i=0,_l=this.list.length;_l>_i;_i++)this.list[_i][CG.key]=!1;var checkbox_els=_this.body.find('[data-editor-key="'+ii+","+c+'"]').get(0);return event&&"INPUT"!=event.target.tagName&&"checkbox"==CG.editor.type?_this.updateItem(r,c,ii,!checkbox_els.checked):event&&"INPUT"!=event.target.tagName&&"radio"==CG.editor.type?_this.updateItem(r,c,ii,!0):_this.updateItem(r,c,ii,checkbox_els.checked),this}return"finder"==CG.editor.type?(CG.editor.finder.onclick.call({id:cfg.targetID+"_inline_editor",value:jQuery("#"+cfg.targetID+"_inline_editor").val(),r:r,c:c,index:ii,item:_this.list[ii]}),this):(setTimeout(function(){var td,td_ids,td_val,parent_type,inline_editor_id,inline_editor,inline_css,div=_this.body.find("#"+cfg.targetID+"_AX_bodyText_AX_"+r+"_AX_"+c+"_AX_"+ii),AXBindConfig={};return div.get(0)?(td=div.parent(),td_ids=td.get(0).id.split(/_AX_/g),td_val=_this.list[ii][CG.key],parent_type=td_ids[td_ids.length-4],inline_editor_id=cfg.targetID+"_AX_inline_editor_AX_"+r+"_AX_"+c+"_AX_"+ii,td_val=_this.getFormatterValue(CG.editor.formatter,_this.list[ii],ii,td_val,CG.key,{},0),po.push('
'),po.push(get_editor(CG.editor,td_val)),po.push("
"),div.after(po.join("")),inline_editor=jQuery("#"+inline_editor_id),inline_css=div.position(),inline_css.width=div.width(),inline_editor.css(inline_css).find("input").select(),_this.inline_edit={editor:inline_editor,r:r,c:c,ii:ii,cell:div},inline_editor.find("input").get(0)&&"calendar"!=CG.editor.type&&"AXSelector"!=CG.editor.type&&jQuery(document.body).unbind("click.axgrid").bind("click.axgrid",function(e){var target=axf.get_event_target(e.target,{id:inline_editor_id});target||(_this.updateItem(r,c,ii,inline_editor.find("input").val()),jQuery(document.body).unbind("click.axgrid"),_this.gridFocus.focus())}),jQuery.extend(AXBindConfig,CG.editor.config),CG.editor.type in _this.inlineEditor&&_this.inlineEditor[CG.editor.type].init.call(_this,inline_editor,AXBindConfig,CG,r,c,ii),void inline_editor.bind("keydown",function(e){if(e||(e=window.event),(e.keyCode==axf.Event.KEY_RETURN||e.keyCode==axf.Event.KEY_TAB)&&!e.altKey)try{e.preventDefault&&event.preventDefault(),e.stopPropagation&&event.stopPropagation(),e.cancelBubble=!0}catch(err){}setTimeout(function(){if(e.keyCode!=axf.Event.KEY_DOWN&&e.keyCode!=axf.Event.KEY_UP&&e.keyCode!=axf.Event.KEY_RETURN&&e.keyCode!=axf.Event.KEY_TAB||e.altKey)e.keyCode==axf.Event.KEY_ESC&&_this.editCellClear();else{if(e.keyCode!=axf.Event.KEY_RETURN&&e.keyCode!=axf.Event.KEY_TAB||(jQuery(document.body).trigger("click.axgrid"),_this.gridFocus.focus()),e.keyCode==axf.Event.KEY_RETURN||e.keyCode==axf.Event.KEY_UP||e.keyCode==axf.Event.KEY_DOWN){var new_ii;new_ii=e.shiftKey&&e.keyCode==axf.Event.KEY_RETURN||e.keyCode==axf.Event.KEY_UP?ii.number()-1:ii.number()+1,0>new_ii&&(new_ii=_this.list.length-1),_this.list.length>new_ii&&_this.editCell(r,c,new_ii)}else if(e.keyCode==axf.Event.KEY_TAB){var new_c,ci,cl;if(ci=0,cl=cfg.colGroup.length,e.shiftKey&&e.keyCode==axf.Event.KEY_TAB){for(ci=cl-1;ci>-1;ci--)if(cfg.colGroup[ci].editor&&"finder"!=cfg.colGroup[ci].editor.type)if("undefined"==typeof new_c)new_c=ci;else if(c>ci){new_c=ci;break}}else for(;cl>ci;ci++)if(cfg.colGroup[ci].editor&&"finder"!=cfg.colGroup[ci].editor.type)if("undefined"==typeof new_c)new_c=ci;else if(ci>c){new_c=ci;break}_this.editCell(r,new_c,ii)}_this.stopEvent(e)}},10)})):(3>(0|times)?_this.editCell(r,c,ii,(0|times)+1):console.log("에디팅 타겟을 찾을 수 없습니다. AXGrid.editCell"),!1)},10),get_editor=function(cond,val){"undefined"==typeof val&&(val="");var _val,po=[],maxLength="";if(cond.maxLength&&(maxLength=' maxLength="'+cond.maxLength+'"'),"select"===cond.type||"AXSelect"===cond.type){if(_val="string"==typeof val||"number"==typeof val||"boolean"==typeof val?val:val[cond.optionValue||"optionValue"],po.push('")}else"AXSelector"===cond.type?(_val="string"==typeof val||"number"==typeof val||"boolean"==typeof val?val:cond.config.reserveKeys?val[cond.config.reserveKeys.optionText]:val.optionText,po.push('")):"finder"==cond.type?(po.push('"),po.push('')):po.push('");return po.join("")},this)},editCellClear:function(){if(this.inline_edit){if(this.inline_edit.r==arguments[0]&&this.inline_edit.c==arguments[1]&&this.inline_edit.ii==arguments[2])return!1;if("undefined"!=typeof arguments[2]&&this.inline_edit&&this.inline_edit.editor.find("input").get(0)){var r,c,ii,ids=this.inline_edit.editor.get(0).id.split(/_AX_/g);r=ids[ids.length-3],c=ids[ids.length-2],ii=ids[ids.length-1],this.updateItem(r,c,ii,this.inline_edit.editor.find("input").val())}else{try{this.inline_edit.editor.find("input").unbindInput()}catch(e){}this.inline_edit.editor.remove(),this.inline_edit=null}}return jQuery(document.body).unbind("click.axgrid"),this},setEditCellValue:function(val){return this.inline_edit&&this.inline_edit.editor.find("input, select, textarea").val(val),this},updateItem:function(r,c,itemIndex,value){function cellUpdate(){if(_this.inline_edit.cell.html(_this.getFormatterValue(CH.formatter,item,itemIndex,item[CH.key],CH.key,CH,c)),CG.editor.updateWith)for(var i=0,l=CG.editor.updateWith.length;l>i;i++){var wCH,wc,v=CG.editor.updateWith[i];axf.each(cfg.colGroup,function(cidx,C){return C.key==v?(wc=cidx,!1):void 0}),"number"==typeof wc&&(wCH=cfg.body.rows[r][wc],_this.body.find("#"+cfg.targetID+"_AX_bodyText_AX_"+r+"_AX_"+wc+"_AX_"+itemIndex).html(_this.getFormatterValue(wCH.formatter,item,itemIndex,item[v],v,wCH,wc)))}}var _this=this,cfg=this.config,CH=cfg.body.rows[r][c],item=this.list[itemIndex],CG=cfg.colGroup[c],that={grid:this,item:item,index:itemIndex,value:item[CG.key],CG:CG,r:r,c:c};if(cfg.control_lock_status>1)return this;var beforeValue=_this.list[itemIndex][CH.key];if(CG.editor&&(CG.editor.type in _this.inlineEditor&&(value=_this.inlineEditor[CG.editor.type].getValue.call(that,value)),CG.editor.beforeUpdate&&(value=CG.editor.beforeUpdate.call(that,value))),_this.list[itemIndex][CH.key]=value,"C"!=_this.list[itemIndex]._CUD&&"D"!=_this.list[itemIndex]._CUD){var isChanged=!1;if(Object.isObject(beforeValue)){var beforeValueString=Object.values(beforeValue).join("_"),valueString=Object.values(value).join("_");isChanged=beforeValueString!=valueString}else isChanged=beforeValue!=value;isChanged&&(_this.list[itemIndex]._CUD="U")}return this.inline_edit&&CG.editor?(cellUpdate(),_this.list[itemIndex][CH.key+"_VAL"]&&(_this.list[itemIndex][CH.key+"_VAL"]._modify=!0),CG.editor.afterUpdate&&CG.editor.afterUpdate.call(that,value),_this.editCellClear()):this.bigDataSyncApply("reload"),this},contentScrollResize:function(resetLeft){var cfg=this.config,_this=this;if("mobile"!=cfg.viewMode){var bodyHeight=_this.body.height(),scrollHeight=_this.scrollContent.height(),bodyWidth=_this.body.width(),_colWidth=_this.colWidth.number()+cfg.fitToWidthRightMargin,scrollWidth=_colWidth>bodyWidth?_colWidth:bodyWidth;_this.scrollContent.css({width:scrollWidth}),_this.colHead.css({width:scrollWidth}),_this.hasEditor&&_this.editor.css({width:bodyWidth}),_this.hasFoot&&(this.cachedDom&&function(){if(this.cachedDom.tbody.find("#"+cfg.targetID+"_AX_null_AX_0").outerHeight()){var itemTrHeight=this.cachedDom.tbody.find("#"+cfg.targetID+"_AX_null_AX_0").outerHeight().number(),printListCount=(this.body.height()/itemTrHeight).ceil(),_count=0;printListCountbodyWidth+4&&cfg.xscroll&&(show_scroll_x=!0),show_scroll_x){_this.scrollTrackX.show(),_this.scrollTrackX.css({width:bodyWidth}),scrollContentAdjust=_this.scrollTrackX.outerHeight();var scrollXHandleWidth=bodyWidth*bodyWidth/scrollWidth;_this.scrollXHandle.data("width",scrollXHandleWidth),30>scrollXHandleWidth&&(scrollXHandleWidth=30),_this.scrollXHandle.css({width:scrollXHandleWidth})}else _this.scrollTrackX.hide();if("auto"==cfg.__height?(_this.scrollBody.css({height:_this.colHead.outerHeight()+_this.scrollContent.height()+scrollContentAdjust}),_this.body.css({top:_this.colHead.outerHeight(),height:_this.scrollContent.height()})):(_this.body.css({height:cfg.height.number()-("show"==this.pageBody.data("display")?this.pageBody.outerHeight():0)-2-this.colHead.outerHeight()-scrollContentAdjust}),_this.scrollTrackY.css({top:_this.colHead.outerHeight(),height:bodyHeight})),bodyHeight=_this.body.height(),scrollHeight=_this.scrollContent.height(),"auto"==cfg.__height?show_scroll_y=!1:scrollHeight>bodyHeight&&(show_scroll_y=!0),show_scroll_y){_this.scrollTrackY.show(),_this.scrollTrackY.css({top:_this.colHead.outerHeight(),height:bodyHeight});var scrollYHandleHeight=bodyHeight*bodyHeight/scrollHeight;_this.scrollYHandle.data("height",scrollYHandleHeight),30>scrollYHandleHeight&&(scrollYHandleHeight=30),_this.scrollYHandle.css({height:scrollYHandleHeight})}else _this.scrollTrackY.hide();return _this.onevent_grid({type:"scroll-resize"}),this}},contentScrollScrollSync:function(pos){var cfg=this.config;if(void 0!=pos.left){if(!this.contentScrollXAttr){var scrollWidth=this.colWidth>this.colHead.width()?this.colWidth:this.colHead.width();this.contentScrollXAttr={bodyWidth:this.body.width(),scrollWidth:scrollWidth,scrollTrackXWidth:this.scrollTrackX.width(),scrollXHandleWidth:this.scrollXHandle.outerHeight()}}var L=function(D){return(D.scrollWidth*pos.left/(D.scrollTrackXWidth-D.scrollXHandleWidth)).round()}(this.contentScrollXAttr);this.contentScrollXAttr.scrollWidth-Lthis.body.width()?this.colWidth:this.body.width();this.contentScrollXAttr={bodyWidth:this.body.width(),scrollWidth:scrollWidth,scrollTrackXWidth:this.scrollTrackX.width(),scrollXHandleWidth:this.scrollXHandle.outerWidth()}}var L=(this.contentScrollXAttr.scrollTrackXWidth-this.contentScrollXAttr.scrollXHandleWidth)*(pos.left/(this.contentScrollXAttr.scrollWidth-this.contentScrollXAttr.bodyWidth));this.scrollXHandle.css({left:-L}),this.colHead.css({left:pos.left}),this.hasFoot&&this.gridFoot_content.css({left:pos.left}),this.hasEditor&&axdom("#"+cfg.targetID+"_AX_editorContent").css({left:pos.left})}else{if("auto"==cfg.__height)return;this.contentScrollYAttr?(this.contentScrollYAttr.bodyHeight=this.body.height(),this.contentScrollYAttr.scrollHeight=this.scrollContent.height(),this.contentScrollYAttr.scrollTrackYHeight=this.scrollTrackY.height(),this.contentScrollYAttr.scrollYHandleHeight=this.scrollYHandle.outerHeight()):this.contentScrollYAttr={bodyHeight:this.body.height(),scrollHeight:this.scrollContent.height(),scrollTrackYHeight:this.scrollTrackY.height(),scrollYHandleHeight:this.scrollYHandle.outerHeight()};var _sh=this.contentScrollYAttr.scrollHeight,_bh=this.contentScrollYAttr.bodyHeight,_th=this.contentScrollYAttr.scrollTrackYHeight,_hh=this.contentScrollYAttr.scrollYHandleHeight,T=pos.top*(_th-_hh)/(_sh-_bh);this.scrollYHandle.css({top:-T}),axf.getId(cfg.targetID+"_AX_fixedScrollContent")&&this.fixedScrollContent.css({top:pos.top}),this.editorOpend&&this.editor.css({top:pos.top+this.editorOpenTop+this.body.position().top})}reload||("undefined"==typeof touch&&this.bigDataSync(),"direct"==touch&&this.bigDataSyncApply())},getMousePositionToContentScroll:function(event,contentScrollID){var pos=axdom("#"+contentScrollID).offset(),x=event.pageX-pos.left,y=event.pageY-pos.top;return{x:x,y:y}},getTouchPositionToContentScroll:function(event){var x,y,cfg=this.config,touch=event.touches[0];return cfg.touchDirection?(x=touch.pageX.round(10),y=touch.pageY.round(10)):(x=-touch.pageX.round(10),y=-touch.pageY.round(10)),{x:x,y:y}},contentScrollScrollReady:function(event){var cfg=this.config,handleName=event.target.id.split(/_AX_/).last();this.contentScrollAttrs={handleName:handleName},this.contentScrollXAttr=null,this.contentScrollYAttr=null,"scrollYHandle"==handleName?this.contentScrollAttrs.scrollTrack=cfg.targetID+"_AX_scrollTrackY":this.contentScrollAttrs.scrollTrack=cfg.targetID+"_AX_scrollTrackX",axdom(event.target).addClass("hover");var pos=this.getMousePositionToContentScroll(event,this.contentScrollAttrs.scrollTrack);this.contentScrollAttrs.x=axdom(event.target).position().left-pos.x,this.contentScrollAttrs.y=axdom(event.target).position().top-pos.y,this.contentScrollAttrs.handleWidth=axdom(event.target).outerWidth(),this.contentScrollAttrs.handleHeight=axdom(event.target).outerHeight(),this.contentScrollAttrs.trackWidth=this.scrollTrackX.width(),this.contentScrollAttrs.trackHeight=this.scrollTrackY.height(),this.contentScrollYAttr?(this.contentScrollYAttr.scrollHeight=this.scrollContent.height(),this.contentScrollYAttr.scrollTrackYHeight=this.scrollTrackY.height(),this.contentScrollYAttr.scrollYHandleHeight=this.scrollYHandle.outerHeight()):this.contentScrollYAttr={bodyHeight:this.body.height(),scrollHeight:this.scrollContent.outerHeight(),scrollTrackYHeight:this.scrollTrackY.height(),scrollYHandleHeight:this.scrollYHandle.outerHeight()};var contentScrollScrollMove=this.contentScrollScrollMove.bind(this);this.contentScrollScrollMoveBind=function(event){contentScrollScrollMove(event)};var contentScrollScrollEnd=this.contentScrollScrollEnd.bind(this);this.contentScrollScrollEndBind=function(event){contentScrollScrollEnd(event)},"scrollYHandle"==handleName&&(this.scrollYTip.show(),this.contentScrollTipOverMove()),axdom(document.body).bind("mousemove.AXGrid",this.contentScrollScrollMoveBind),axdom(document.body).bind("mouseup.AXGrid",this.contentScrollScrollEndBind),axdom(document.body).bind("mouseleave.AXGrid",this.contentScrollScrollEndBind),axdom(document.body).attr("onselectstart","return false"),this.contentScrollScrolling=!0},contentScrollScrollMove:function(event){var pos=(this.config,this.getMousePositionToContentScroll(event,this.contentScrollAttrs.scrollTrack)),handleName=this.contentScrollAttrs.handleName,handleTop=0,handleLeft=0;"scrollYHandle"==handleName?(handleTop=pos.y+this.contentScrollAttrs.y,0>handleTop&&(handleTop=0),handleTop+this.contentScrollAttrs.handleHeight>this.contentScrollAttrs.trackHeight&&(handleTop=this.contentScrollAttrs.trackHeight-this.contentScrollAttrs.handleHeight),this.scrollYHandle.css({top:handleTop}),this.scrollYHandle.data("top",handleTop),this.contentScrollScrollSync({top:handleTop}),this.contentScrollTipOverMove(handleTop)):(handleLeft=pos.x+this.contentScrollAttrs.x,0>handleLeft&&(handleLeft=0),handleLeft+this.contentScrollAttrs.handleWidth>this.contentScrollAttrs.trackWidth&&(handleLeft=this.contentScrollAttrs.trackWidth-this.contentScrollAttrs.handleWidth),this.scrollXHandle.css({left:handleLeft}),this.contentScrollScrollSync({left:handleLeft})),this.onevent_grid({type:"onscroll"})},contentScrollScrollEnd:function(event){var cfg=this.config;axdom(document.body).unbind("mousemove.AXGrid"),axdom(document.body).unbind("mouseup.AXGrid"),axdom(document.body).unbind("mouseleave.AXGrid"),axdom(document.body).removeAttr("onselectstart"),axdom("#"+cfg.targetID+"_AX_"+this.contentScrollAttrs.handleName).removeClass("hover"),this.contentScrollScrolling=!1,"scrollYHandle"==this.contentScrollAttrs.handleName?(this.contentScrollScrollSync({top:this.scrollYHandle.position().top}),this.contentScrollAttrs.trackHeight-this.contentScrollAttrs.handleHeight==this.scrollYHandle.data("top")&&this.contentScrollEnd(),this.scrollYTip.hide()):this.contentScrollScrollSync({left:this.scrollXHandle.position().left})},contentScrollScrollWheel:function(e){var attr,cfg=this.config,scrollTop=this.scrollContent.position().top,scrollLeft=this.scrollContent.position().left,eventCancle=!1,event=e||window.event,deltaX=0,deltaY=0;if("auto"!=cfg.__height){if(attr={bodyHeight:this.body.height(),bodyWidth:this.body.width()},attr.scrollHeight=this.scrollContent.height(),attr.scrollWidth=this.scrollContent.width(),attr.scrollTrackYHeight=this.scrollTrackY.height(),attr.scrollYHandleHeight=this.scrollYHandle.outerHeight(),attr.scrollTrackYWidth=this.scrollTrackY.width(),attr.scrollYHandleWidth=this.scrollYHandle.outerWidth(),event.wheelDeltaX?(deltaX=(event.wheelDeltaX/2).ceil(),deltaY=(event.wheelDeltaY/2).ceil()):deltaY=(event.detail?-20*event.detail:event.wheelDelta/2).ceil(),0==deltaX&&0==deltaY)return!0;if(deltaY.abs()>deltaX.abs()&&deltaY.abs()>0){if(attr.scrollHeight0?(scrollTop=0,eventCancle=!0):scrollTop.abs()+attr.bodyHeight>attr.scrollHeight?(scrollTop=attr.bodyHeight-attr.scrollHeight,eventCancle=!0):0==scrollTop&&(scrollTop=0,eventCancle=!0),this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop},"direct"),this.onevent_grid({type:"onscroll"})}else deltaX.abs()>deltaY.abs()&&deltaX.abs()>0&&(scrollLeft+=deltaX,scrollLeft>0?(scrollLeft=0,eventCancle=!0):scrollLeft.abs()+attr.bodyWidth>attr.scrollWidth?(scrollLeft=attr.bodyWidth-attr.scrollWidth,eventCancle=!0):0==scrollLeft&&(scrollLeft=0,eventCancle=!0),this.scrollContent.css({left:scrollLeft}),this.contentScrollContentSync({left:scrollLeft},"direct"),this.onevent_grid({type:"onscroll"}));if(!eventCancle)return event.preventDefault&&event.preventDefault(),event.stopPropagation&&event.stopPropagation(),event.cancelBubble=!0,!1;if(0!=scrollTop){var contentScrollEnd=this.contentScrollEnd.bind(this);this.contentScrollEndObserver&&clearTimeout(this.contentScrollEndObserver),this.contentScrollEndObserver=setTimeout(function(){contentScrollEnd()},100)}}},contentScrollTouchstart:function(e){var cfg=this.config,event=window.event||e;if("mobile"!=cfg.viewMode){this.contentScrollTouchMoved=!0,this.contentScrollIDOffset=this.scrollContent.offset(),this.contentScrollXAttr=null,this.contentScrollYAttr=null;var pos=this.getTouchPositionToContentScroll(event);this.scrollYHandle.addClass("hover"),this.scrollXHandle.addClass("hover"),this.scrollTouchAttr={y:pos.y,h:this.body.outerHeight(),th:this.scrollContent.height(),nt:this.scrollContent.position().top,x:pos.x,w:this.body.outerWidth(),tw:this.scrollContent.width(),nl:this.scrollContent.position().left};var contentScrollTouchEnd=this.contentScrollTouchEnd.bind(this);this.contentScrollTouchEndBind=function(){contentScrollTouchEnd(event)};var contentScrollTouchMove=this.contentScrollTouchMove.bind(this);this.contentScrollTouchMoveBind=function(){contentScrollTouchMove(event)},document.addEventListener&&(document.addEventListener("touchend",this.contentScrollTouchEndBind,!1),document.addEventListener("touchmove",this.contentScrollTouchMoveBind,!1))}},contentScrollTouchMove:function(e){var cfg=this.config,event=window.event||e;if(this.contentScrollTouchMoved){var pos=this.getTouchPositionToContentScroll(event),scrollTouchAttr=this.scrollTouchAttr,eventCancle=!1;if(scrollTouchAttr.th>scrollTouchAttr.h&&"auto"!=cfg.height){var scrollTop=scrollTouchAttr.nt-(pos.y-scrollTouchAttr.y);scrollTop>0?(scrollTop=0,eventCancle=!0):scrollTop.abs()+scrollTouchAttr.h>scrollTouchAttr.th?(scrollTop=scrollTouchAttr.h-scrollTouchAttr.th,eventCancle=!0):0==scrollTop&&(scrollTop=0,eventCancle=!0),this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop},"touch")}else eventCancle=!0;if(this.show_scrollTrackX&&(pos.x-scrollTouchAttr.x).abs()>8){eventCancle=!1;var scrollLeft=scrollTouchAttr.nl-(pos.x-scrollTouchAttr.x);scrollLeft>0?(scrollLeft=0,eventCancle=!0):scrollLeft.abs()+scrollTouchAttr.w>scrollTouchAttr.tw?(scrollLeft=scrollTouchAttr.w-scrollTouchAttr.tw,eventCancle=!0):0==scrollLeft&&(scrollLeft=0,eventCancle=!0), this.scrollContent.css({left:scrollLeft}),this.contentScrollContentSync({left:scrollLeft},"touch")}if(eventCancle){if(0!=scrollTop){var contentScrollEnd=this.contentScrollEnd.bind(this);this.contentScrollEndObserver&&clearTimeout(this.contentScrollEndObserver),this.contentScrollEndObserver=setTimeout(function(){contentScrollEnd()},100)}}else event.preventDefault&&event.preventDefault()}},contentScrollTouchEnd:function(e){var cfg=this.config;window.event||e;this.contentScrollTouchMoved&&("auto"!=cfg.height&&this.bigDataSync(),this.scrollXHandle.removeClass("hover"),this.scrollYHandle.removeClass("hover"),document.removeEventListener&&(document.removeEventListener("touchend",this.contentScrollTouchEndBind,!1),document.removeEventListener("touchmove",this.contentScrollTouchMoveBind,!1)),this.contentScrollTouchMoved=!1)},contentScrollEnd:function(){this.contentScrollEndObserver&&clearTimeout(this.contentScrollEndObserver);var cfg=this.config;if(cfg.body.onscrollend)try{cfg.body.onscrollend.call({list:this.list,page:this.page})}catch(e){console.log(e)}},contentScrollTipOver:function(event){},contentScrollTipOverMove:function(handleTop){var hTop=(this.config,handleTop||this.scrollYHandle.position().top),T=(this.contentScrollYAttr.scrollHeight-this.contentScrollYAttr.bodyHeight)*(hTop/(this.contentScrollYAttr.scrollTrackYHeight-this.contentScrollYAttr.scrollYHandleHeight)).number();this.scrollYTipSpan.empty(),this.scrollYTipSpan.append((T.abs()/this.virtualScroll.itemTrHeight).floor().money()+"/"+this.list.length.money()),this.scrollYTip.css({top:hTop})},contentScrollTipOverOut:function(event){this.config;this.scrollYHandle.unbind("mousemove"),this.scrollYHandle.unbind("mouseout"),this.scrollYTip.hide()},dataSync:function(){return this.bigDataSync(!0),this},bigDataSync:function(reload){var cfg=this.config,_this=this;"grid"==cfg.viewMode&&(this.bigDataSyncObserver&&clearTimeout(this.bigDataSyncObserver),this.bigDataSyncObserver=setTimeout(function(){_this.bigDataSyncApply(reload)},10))},bigDataSyncApply:function(reload){var cfg=this.config;if("grid"!=cfg.viewMode)return this;var scrollContentScrollTop,item,bodyHasMarker=this.bodyHasMarker,getItem=this.getItem.bind(this),getItemMarker=this.getItemMarker.bind(this),getMarkerDisplay=this.getMarkerDisplay.bind(this),markerIndex=0,VS=this.virtualScroll,po=[];if(VS.scrollTop!=(scrollContentScrollTop=this.scrollContent.position().top)||reload){var newStartIndex=(scrollContentScrollTop.abs()/VS.itemTrHeight).ceil()-6;0>newStartIndex&&(newStartIndex=0);var newEndIndex=newStartIndex+VS.printListCount;if(newEndIndex>this.list.length&&(newEndIndex=this.list.length),VS.startIndex!=newStartIndex||reload){po=[];for(var itemIndex=newStartIndex;newEndIndex>itemIndex;itemIndex++)item=this.list[itemIndex],po.push(getItem(itemIndex,item,"n")),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getItemMarker(itemIndex,item,"n",markerIndex));if(this.cachedDom.tbody.empty(),this.cachedDom.tbody.append(po.join("")),VS.startIndex=newStartIndex,VS.endIndex=newEndIndex,VS.scrollTop=scrollContentScrollTop,cfg.mergeCells&&this.mergeCells(this.cachedDom.tbody,"n"),this.hasFixed){po=[];for(var itemIndex=newStartIndex;newEndIndex>itemIndex;itemIndex++)item=this.list[itemIndex],po.push(getItem(itemIndex,item,"fix")),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getItemMarker(itemIndex,item,"fix",markerIndex));this.cachedDom.fixed_tbody.empty(),this.cachedDom.fixed_tbody.append(po.join("")),cfg.mergeCells&&this.mergeCells(this.cachedDom.fixed_tbody,"f")}this.cachedDom.thpadding.css({height:newStartIndex*VS.itemTrHeight});var tfpaddingHeight=cfg.scrollContentBottomMargin.number()+(this.list.length-newEndIndex-1)*VS.itemTrHeight;if(tfpaddingHeight0){for(var body=this.body,ri=0;ribodyHeight){var scrollTop=bodyHeight-(trTop.number()+trHeight.number());this.scrollContent.css({top:scrollTop-cfg.listCountMargin}),this.contentScrollContentSync({top:scrollTop-cfg.listCountMargin})}else if(0==trTop.number()){var scrollTop=0;this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop})}}}}}}},scrollTop:function(itemIndex){var cfg=this.config;if("auto"!=cfg.__height)try{var trTop=this.body.find(".gridBodyTr_"+itemIndex).position().top,trHeight=this.body.find(".gridBodyTr_"+itemIndex).height(),scrollHeight=this.scrollContent.height(),bodyHeight=this.body.height();this.scrollYHandle.outerHeight(),this.scrollTrackY.height();if(trTop.number()+trHeight.number()>bodyHeight){var scrollTop=bodyHeight-(trTop.number()+trHeight.number());this.body.height()0){var body=this.body;axf.each(this.selectedRow,function(ridx,Row){body.find(".gridBodyTr_"+Row).removeClass("selected"),_this.selectedCells.length>0&&axf.each(_this.selectedCells,function(){body.find(".gridBodyTr_"+Row).find(".bodyTd_"+this).removeClass("selected")})})}if(this._focusedItemIndex=itemIndex,this.virtualScroll.startIndex<=itemIndex&&this.virtualScroll.endIndex>=itemIndex){this.selectedRow.clear(),0==itemIndex&&(itemIndex=""+itemIndex),this.body.find(".gridBodyTr_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex),cfg.mergeCells&&function(){for(var colGroupLen=0,nowTrTd=this.body.find(".gridBodyTr_"+itemIndex).find("td"),i=0,l=cfg.colGroup.length;l>i;i++)cfg.colGroup[i].display&&colGroupLen++;if(colGroupLen==nowTrTd.length-1){for(var i=0,l=nowTrTd.length;l>i;i++)if(nowTrTd[i].getAttribute("rowspan")>1){for(var ai=0;aii;i++)if(_nowTrTd[i].getAttribute("rowspan")>1){for(var ai=0;ai<_nowTrTd[i].getAttribute("rowspan");ai++)this.body.find(".gridBodyTr_"+(Number(parentItemIndex)+ai)).addClass("selected"),this.selectedRow.push(Number(parentItemIndex)+ai);break}finding=!1}safeLoop++,safeLoop>1e3&&(finding=!1)}while(finding)}}.call(this),this.body.find(".gridBodyTr_"+itemIndex).find(".bodyTd_"+c_index+".bodyTdr_0").addClass("selected");var scrollTop,trTop=this.body.find(".gridBodyTr_"+itemIndex).position().top,trHeight=this.body.find(".gridBodyTr_"+itemIndex).height(),scrollHeight=this.scrollContent.height(),bodyHeight=this.body.height(),scrollContentTop=(this.scrollYHandle.outerHeight(),this.scrollTrackY.height(),this.scrollContent.position().top);_this.hasFoot&&(bodyHeight-=this.gridFoot.height()),cfg.body.rowsEmpty||(trHeight=cfg.body.rows.length*trHeight),trTop.number()+scrollContentTop<0?(scrollTop=-trTop.number(),this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop})):trTop.number()+trHeight.number()+scrollContentTop>bodyHeight?(scrollTop=bodyHeight-(trTop.number()+trHeight.number()),this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop})):0==trTop.number()&&(scrollTop=0,this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop}))}else if(this.list.length>itemIndex&&itemIndex>-1){0==itemIndex&&(itemIndex=""+itemIndex);var scrollHeight=this.scrollContent.height(),bodyHeight=this.body.height(),scrollTop=(this.scrollYHandle.outerHeight(),this.scrollTrackY.height(),this.virtualScroll.itemTrHeight*itemIndex);bodyHeight>=scrollHeight&&(scrollTop=0),this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop},"direct"),setTimeout(function(){if(_this.body.find(".gridBodyTr_"+itemIndex).get(0)){var trTop=_this.body.find(".gridBodyTr_"+itemIndex).position().top,trHeight=_this.body.find(".gridBodyTr_"+itemIndex).height();trTop.number()+trHeight.number()>bodyHeight?(scrollTop=bodyHeight-(trTop.number()+trHeight.number()),itemIndex==_this.list.length-1&&(scrollTop-=10),_this.scrollContent.css({top:scrollTop}),_this.contentScrollContentSync({top:scrollTop},"direct")):0==trTop.number()&&(scrollTop=0,_this.scrollContent.css({top:scrollTop}),_this.contentScrollContentSync({top:scrollTop},"direct")),_this.selectedRow.clear(),_this.selectedRow.push(itemIndex),_this.body.find(".gridBodyTr_"+itemIndex).addClass("selected"),cfg.mergeCells&&function(){for(var colGroupLen=0,nowTrTd=this.body.find(".gridBodyTr_"+itemIndex).find("td"),i=0,l=cfg.colGroup.length;l>i;i++)cfg.colGroup[i].display&&colGroupLen++;if(colGroupLen==nowTrTd.length-1){for(var i=0,l=nowTrTd.length;l>i;i++)if(nowTrTd[i].getAttribute("rowspan")>1){for(var ai=0;aii;i++)if(_nowTrTd[i].getAttribute("rowspan")>1){for(var ai=0;ai<_nowTrTd[i].getAttribute("rowspan");ai++)this.body.find(".gridBodyTr_"+(Number(parentItemIndex)+ai)).addClass("selected"),this.selectedRow.push(Number(parentItemIndex)+ai);break}finding=!1}safeLoop++,safeLoop>1e3&&(finding=!1)}while(finding)}}.call(_this)}})}else this._focusedItemIndex=void 0;this.onevent_grid({type:"grid-list-focus"})}else if("icon"==cfg.viewMode);else if("mobile"==cfg.viewMode){if(this.selectedCells.length>0&&(axf.each(this.selectedCells,function(){axdom("#"+this).removeClass("selected")}),this.selectedCells.clear()),this.selectedRow.length>0){var body=this.body;axf.each(this.selectedRow,function(){body.find(".bodyViewMobile_"+this).removeClass("selected")})}this.selectedRow.clear(),this.body.find(".bodyViewMobile_"+itemIndex).addClass("selected"),this.selectedRow.push(itemIndex),this.body.find(".bodyViewMobile_"+itemIndex).focus()}},focusMove:function(direction,event){var myIndex,my_c,itemIndex,cfg=this.config,body=this.body;if("L"==direction||"R"==direction)this.selectedCells.length>0&&(myIndex=this.selectedRow.first(),my_c=this.selectedCells.first(),"L"==direction?(my_c-=1,0>my_c&&(my_c=0)):(my_c=my_c.number()+1,my_c>=cfg.colGroup.length&&(my_c=cfg.colGroup.length-1)),axf.each(this.selectedCells,function(){body.find(".gridBodyTr_"+myIndex).find(".bodyTd_"+this).removeClass("selected")}),this.selectedCells.clear(),this.body.find(".gridBodyTr_"+myIndex).find(".bodyTd_"+my_c+".bodyTdr_0").addClass("selected"),this.selectedCells.push(my_c),this.stopEvent(event));else{for(myIndex=this.selectedRow.first(),cfg.mergeCells&&this.selectedRow.length>1&&direction>0&&1==Math.abs(this.selectedRow[0]-this.selectedRow[1])&&(myIndex=this.selectedRow.last()),itemIndex=myIndex.number()+direction,0>itemIndex?itemIndex=0:itemIndex>this.list.length-1&&(itemIndex=this.list.length-1);this.list[itemIndex][cfg.reserveKeys.hidden];)0>direction?(itemIndex--,0>itemIndex&&(itemIndex=0)):(itemIndex++,itemIndex>this.list.length-1&&(itemIndex=this.list.length-1));this.setFocus(itemIndex),this.stopEvent(event)}return!1},getSelectedItem:function(){this.config;if(void 0!=this.selectedRow&&null!=this.selectedRow&&this.selectedRow.length>0){if(1==this.selectedRow.length)return{index:this.selectedRow.first().number(),item:this.list[this.selectedRow.first()]};for(var selectedList=[],len=this.selectedRow.length,i=0;len>i;i++)selectedList.push(this.list[this.selectedRow[i]]);return{index:this.selectedRow,item:selectedList}}return{error:"noselected",description:"선택된 item이 없습니다."}},click:function(itemIndex){var cfg=this.config;this.setFocus(itemIndex);var item=this.list[itemIndex];if(cfg.body.onclick){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page};try{cfg.body.onclick.call(sendObj,itemIndex,item)}catch(e){console.log(e)}}},mergeCells:function(tgDom,typ){for(var cfg=this.config,rows=[],typn="f"==typ?"fix":"n",tri=this.virtualScroll.startIndex;tri<=this.virtualScroll.endIndex;tri++){var row=[];if(this.list[tri]){for(var tdi=0;tdi0||0==cfg.fixedColSeq)&&rows[tri][tdi].tdom.css({height:this.virtualScroll.itemTrHeight*rows[tri][tdi].rowspan-1}));return rows=null,this},getDataSetFormatterValue:function(formatter,dataSet,value,key,CH){var result;this.config;if("money"==formatter)result=""==value||"null"==value||void 0==value?"0":value.number().money();else if("dec"==formatter)result=void 0==value?"":value.dec();else if("html"==formatter)result=value;else if("checkbox"==formatter||"radio"==formatter)result=value;else{var sendObj={index:null,list:this.list,item:dataSet,dataSet:dataSet,page:this.page,key:key,value:value};try{result=formatter.call(sendObj)}catch(e){console.log(e)}}return result},getHeadDataSet:function(dataSet,isfix){var cfg=this.config;if(void 0!=dataSet){var tpo=[],getDataSetFormatterValue=this.getDataSetFormatterValue.bind(this);axf.each(cfg.colGroup,function(){void 0==dataSet[this.key]&&(dataSet[this.key]="")});for(var hasFixed=this.hasFixed,r=0;r');var colCount=0;axf.each(cfg.head.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0&&(void 0==isfix||void 0!=isfix&&colCount1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bottomClass=CH.isLastCell?"":" bodyBottomBorder",fixedClass=CH.isFixedEndCell?" fixedLine":"",bodyNodeClass="";"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push("'),tpo.push('
'),hasFixed&&!CH.isFixedCell||!hasFixed||void 0!=isfix?CH.formatter?tpo.push(getDataSetFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH)):tpo.push(dataSet[CH.key]):tpo.push(" "),tpo.push("
"),tpo.push("")}}),0==r&&void 0==isfix&&tpo.push('
 
'),tpo.push("")}return tpo.join("")}},getFootDataSet:function(dataSet,isfix){var cfg=this.config;if(void 0!=dataSet){var tpo=[],getDataSetFormatterValue=this.getDataSetFormatterValue.bind(this);axf.each(cfg.colGroup,function(){void 0==dataSet[this.key]&&(dataSet[this.key]="")});for(var hasFixed=this.hasFixed,r=0;r');var colCount=0;axf.each(cfg.foot.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0&&("undefined"==typeof isfix||"undefined"!=typeof isfix&&CH.isFixedEndCell)){colCount+=CH.colspan;var rowspan=CH.rowspan>1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bottomClass=CH.isLastCell?"":" bodyBottomBorder",fixedClass=CH.isFixedEndCell?" fixedLine":"",bodyNodeClass="";"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push("'),tpo.push('
'),hasFixed&&!CH.isFixedCell||!hasFixed||void 0!=isfix?CH.formatter?tpo.push(getDataSetFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH)):tpo.push(dataSet[CH.key]):tpo.push(" "),tpo.push("
"),tpo.push("")}}),0==r&&void 0==isfix&&tpo.push('
 
'),tpo.push("")}return tpo.join("")}},setDataSet:function(obj){var cfg=this.config;obj.ajaxUrl||axdom.isPlainObject(obj)&&(this.dataSet=obj,cfg.head&&this.printHead(),cfg.foot&&this.printFoot(),this.contentScrollResize(!1))},redrawDataSet:function(){var cfg=this.config;this.dataSet&&(cfg.head&&this.printHead(),cfg.foot&&this.printFoot())},printHead:function(){var cfg=this.config,getDataSet=this.getHeadDataSet.bind(this),po=[];po.push(getDataSet(this.dataSet)),axdom("#"+cfg.targetID+"_AX_thead").html(po.join("")),this.hasFixed&&(po=[],po.push(getDataSet(this.dataSet,"fix")),axdom("#"+cfg.targetID+"_AX_fixedThead").html(po.join("")))},printFoot:function(){var _tdHeight,cfg=this.config,tableWidth=this.colWidth,getDataSet=this.getFootDataSet.bind(this),po=[];this.hasFoot=!0,po.push('
'),po.push(''),po.push(this.getColGroup("FH")),po.push(""),po.push(getDataSet(this.dataSet)),po.push(""),po.push("
"),po.push("
"),this.hasFixed&&(po.push('
'),po.push(''),po.push(this.getColGroup("FF")),po.push(""),po.push(getDataSet(this.dataSet,"fix")),po.push(""),po.push("
"),po.push("
")),this.gridFoot.html(po.join("")),this.gridFoot.show(),this.gridFoot_content=this.gridFoot.find(".gridFootContent"),this.gridFoot.css({height:this.gridFoot_content.height()}),_tdHeight=void 0,this.gridFoot.find(".bodyTd").each(function(){var tdHeight,td_dom=$(this),rowspan=td_dom.attr("rowspan");td_dom.attr("valign");rowspan||(rowspan=1),"undefined"==typeof _tdHeight&&(_tdHeight=td_dom.height()/rowspan),tdHeight=_tdHeight*rowspan,rowspan>1&&td_dom.css({height:tdHeight+1})}),cfg.scrollContentBottomMargin=this.gridFoot_content.height()},getEditorFormatterValue:function(formatter,dataSet,value,key,CH,idAttr){var result,sendObj;this.config;if("money"==formatter)result=""==value||"null"==value||void 0==value?"0":value.number().money();else if("dec"==formatter)result=void 0==value?"":value.dec();else if("html"==formatter)result=value;else if("checkbox"==formatter||"radio"==formatter)result=value;else{sendObj={index:null,list:this.list,item:dataSet,dataSet:dataSet,page:this.page,key:key,value:value};try{result=formatter.call(sendObj)}catch(e){console.log(e)}}return result},getEditorFormValue:function(form,dataSet,value,key,CH,idAttr){var cfg=this.config,paddingRight=cfg.formPaddingRight,result=[],formClass=form.addClass?" "+form.addClass:"",formWidth=form.width?"width:"+form.width+";":"width:100%;",formHeight=form.height?"height:"+form.height+";":"",formStyle=form.style?form.style:"",formID=form.id?form.id:cfg.targetID+"_AX_"+key+"_AX_"+idAttr,getFormValue=function(formvalue,value){if("itemValue"==formvalue||"itemText"==formvalue)return"undefined"!=typeof value&&axdom.isArray(value)?value:"boolean"==typeof value?value:"string"==typeof value?value.dec():value;if(axdom.isFunction(formvalue)){var sendObj={key:key,value:value,list:this.list,page:this.page};return formvalue.call(sendObj,key,value)}return formvalue};if("hidden"==form.type)result.push(" "),result.push('');else if("text"==form.type)result.push('
'),result.push(''),result.push("
");else if("readonly"==form.type)result.push('
'),result.push(''),result.push("
");else if("textarea"==form.type)result.push('
'),result.push('"),result.push("
");else if("select"==form.type){var formValue=getFormValue(form.value,dataSet[key]);result.push('
'),result.push('"),result.push("
")}else if("radio"==form.type){var formValue=getFormValue(form.value,dataSet[key]);axf.each(form.options,function(oidx,opt){result.push('
")})}else if("checkbox"==form.type){var formValue=getFormValue(form.value,dataSet[key]);axf.each(form.options,function(oidx,opt){if(result.push('
")})}return result.join("")},getEditorBody:function(dataSet,isfix){for(var cfg=this.config,getEditorFormatterValue=this.getEditorFormatterValue.bind(this),getEditorFormValue=this.getEditorFormValue.bind(this),tpo=[],hasFixed=this.hasFixed,r=0;r');var colCount=0;axf.each(cfg.editor.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0){if(void 0==isfix||void 0!=isfix&&colCount1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bottomClass=CH.isLastCell?"":" bodyBottomBorder",fixedClass=CH.isFixedEndCell?" fixedLine":"",bodyNodeClass="";"checkbox"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push("'),tpo.push('
'),hasFixed&&!CH.isFixedCell||!hasFixed||void 0!=isfix?CH.form?tpo.push(getEditorFormValue(CH.form,dataSet,dataSet[CH.key],CH.key,CH,r+"_AX_"+CHidx)):CH.formatter?tpo.push(getEditorFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH,r+"_AX_"+CHidx,CH.form)):tpo.push(dataSet[CH.key]):tpo.push(" "),tpo.push("
"),tpo.push("")}}else tpo.push(''),CH.form?tpo.push(getEditorFormValue(CH.form,dataSet,dataSet[CH.key],CH.key,CH,r+"_AX_"+CHidx)):CH.formatter?tpo.push(getEditorFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH,r+"_AX_"+CHidx,CH.form)):tpo.push(dataSet[CH.key]),tpo.push("")}),0==r&&void 0==isfix&&tpo.push('
 
'),tpo.push("")}return tpo.join("")},setEditor:function(item,itemIndex,insertIndex){var itemTrHeight,cfg=this.config,_this=this;if(this.editorItemIndex=null,!this.hasEditor)return void alert("setConfig 에 editor 가 설정 되지 않아 요청을 처리 할 수 없습니다.");this.unbindAXbind(),this.editorButtonPosition="bottom";var dataSet={};item&&(dataSet=item),axf.each(cfg.colGroup,function(){void 0==dataSet[this.key]&&(dataSet[this.key]="")});var po=[];if(po.push('
'),po.push(''),po.push(this.getColGroup("EB")),po.push(''),po.push(this.getEditorBody(dataSet)),po.push(""),po.push("
"),po.push("
"),this.hasFixed&&(po.push('
'),po.push(''),po.push(this.getColGroup("FE")),po.push(''),po.push(this.getEditorBody(dataSet,"fix")),po.push(""),po.push("
"),po.push("
")),po.push('
'),po.push(' '),po.push(' '),po.push("
"),this.editor.html(po.join("")),"undefined"!=typeof itemIndex){var scrollTop=this.scrollContent.position().top,list=this.list;if("auto"==cfg.__height){var editorTop=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+itemIndex).position().top;itemTrHeight=function(){if(0==list.length)return 0;if(1==list.length){var p2=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+itemIndex).height();return p2}if(list.length-1==itemIndex){var p1=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+(itemIndex-1)).position().top,p2=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+itemIndex).position().top;return p2-p1}var p1=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+itemIndex).position().top,p2=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+(itemIndex.number()+1)).position().top;return p2-p1}()}else var editorTop=itemIndex*(itemTrHeight=this.virtualScroll.itemTrHeight);this.editor.css({top:editorTop+scrollTop+this.body.position().top}),this.editorOpend=!0,this.editorOpenTop=editorTop+this.body.position().top,this.editorItemIndex=itemIndex,this.editorButtonPosition="bottom";var trTop=-editorTop;editorTop+scrollTop+this.body.position().top>this.body.height()-this.body.position().top&&this.scrollContent.height()+this.editor.height()-31>this.body.height()&&0!=this.list.length&&(trTop=this.body.height()-this.scrollContent.height(),this.editorButtonPosition="top")}else if("undefined"!=typeof insertIndex){var scrollTop=this.scrollContent.position().top,list=this.list;if("auto"==cfg.__height){var editorTop=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+insertIndex).position().top,trHeight=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+insertIndex).outerHeight();itemTrHeight=function(){if(0==list.length)return 0;if(1==list.length){var p2=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+insertIndex).height();return p2}if(list.length-1==itemIndex){var p1=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+(insertIndex-1)).position().top,p2=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+insertIndex).position().top;return p2-p1}var p1=axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+insertIndex).position().top,p2=(axdom("#"+cfg.targetID+"_AX_tr_0_AX_n_AX_"+(insertIndex.number()+1)).position()||0).top;return p2-p1}(),editorTop+=trHeight}else var editorTop=insertIndex*(itemTrHeight=this.virtualScroll.itemTrHeight);this.editor.css({top:editorTop+this.body.position().top}),this.editorOpend=!0,this.editorOpenTop=editorTop,this.editorInsertIndex=insertIndex,this.editorButtonPosition="bottom";var trTop=-editorTop;trTop.abs()+this.body.height()>this.scrollContent.height()&&this.scrollContent.height()+this.editor.height()-31>this.body.height()&&this.list.length>0&&(trTop=this.body.height()-this.scrollContent.height(), -this.editorButtonPosition="top"),this.body.height()0){var formID="";CH.AXBind&&(formID=CH.form.id?CH.form.id:cfg.targetID+"_AX_"+CH.key+"_AX_"+r+"_AX_"+CHidx,"number"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindNumber(CH.AXBind.config||{}):"money"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindMoney(CH.AXBind.config||{}):"selector"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindSelector(CH.AXBind.config||{}):"slider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindSlider(CH.AXBind.config||{}):"twinSlider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindTwinSlider(CH.AXBind.config||{}):"date"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindDate(CH.AXBind.config||{}):"twinDate"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindTwinDate(CH.AXBind.config||{}):"dateTime"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindDateTime(CH.AXBind.config||{}):"switch"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindSwitch(CH.AXBind.config||{}):"select"==CH.AXBind.type&&"select"==CH.form.type&&axdom("#"+formID).bindSelect(CH.AXBind.config||{})),CH.form&&(formID=CH.form.id?CH.form.id:cfg.targetID+"_AX_"+CH.key+"_AX_"+r+"_AX_"+CHidx,CH.form.onChange&&axdom("#"+formID).bind("change",function(){CH.form.onChange.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val(),text:axf.getId(formID).options[axf.getId(formID).options.selectedIndex].text})}),CH.form.onClick&&axdom("#"+formID).bind("click",function(){CH.form.onClick.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val()})}),CH.form.onBlur&&axdom("#"+formID).bind("blur",function(){CH.form.onBlur.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val()})}),CH.form.onFocus&&axdom("#"+formID).bind("focus",function(){CH.form.onFocus.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val()})}))}});var editorContent=axdom("#"+cfg.targetID+"_AX_editorContent"),fixedEditorContent=axdom("#"+cfg.targetID+"_AX_fixedEditorContent"),editorButtons=axdom("#"+cfg.targetID+"_AX_editorButtons"),editorContentHeight=editorContent.height(),fixedEditorContentHeight=fixedEditorContent.height();fixedEditorContentHeight>editorContentHeight?(editorContentHeight=fixedEditorContentHeight,editorContent.find(".gridBodyTable").css({height:editorContentHeight})):fixedEditorContent.find(".gridFixedBodyTable").css({height:editorContentHeight}),editorButtons.css({top:editorContentHeight});editorContentHeight.number();itemTrHeight>editorContentHeight&&(editorContentHeight=itemTrHeight,editorContent.find(".gridBodyTable").css({height:editorContentHeight}),fixedEditorContent.find(".gridFixedBodyTable").css({height:editorContentHeight}),this.editor.css({height:editorContentHeight.number()}),editorButtons.css({top:editorContentHeight}));var scrollLeft=this.scrollContent.position().left;editorContent.css({left:scrollLeft}),"top"==this.editorButtonPosition&&(void 0!=insertIndex?this.editor.css({top:this.editor.position().top-editorContentHeight}):this.editor.css({top:this.editor.position().top-editorContentHeight+itemTrHeight}),editorButtons.addClass("top"),editorButtons.css({top:-editorButtons.outerHeight()+1})),axdom("#"+cfg.targetID+"_AX_editorButtons_AX_save").bind("click",this.saveEditor.bind(this)),axdom("#"+cfg.targetID+"_AX_editorButtons_AX_cancel").bind("click",this.cancelEditor.bind(this))},setEditorForm:function(obj){var cfg=this.config,formID=cfg.targetID+"_AX_"+obj.key+"_AX_"+obj.position.join("_AX_");axf.getId(formID)||alert(formID+"로 Element를 찾을 수 없습니다."),axdom("#"+formID).val(obj.value)},focusEditorForm:function(key){this.config;this.editor.find("input[type=text],textarea").each(function(){return this.name==key?(this.focus(),!1):void 0})},saveEditor:function(){var cfg=this.config,editorFormItem={};null==this.editorItemIndex?editorFormItem.requestType="new":editorFormItem.requestType="edit";for(var setEditorFormItemValue=function(k,v,type){editorFormItem[k]&&"checkbox"==type?Object.isArray(editorFormItem[k])?editorFormItem[k].push(v):(editorFormItem[k]=[editorFormItem[k]],editorFormItem[k].push(v)):editorFormItem[k]=v},r=0;r'),po.push('
'),po.push(""),this.editor.html(po.join(""));var saveEditorRequest=this.saveEditorRequest.bind(this),cancelEditor=this.cancelEditor.bind(this),ajax=cfg.editor.request,url=ajax.ajaxUrl,formPars=[];axf.each(editorFormItem,function(k,v){formPars.push(k+"="+v.enc())}),Object.isString(obj.ajaxPars)?formPars.push(obj.ajaxPars):Object.isObject(obj.ajaxPars)&&formPars.push(axdom.param(obj.ajaxPars));var pars=formPars.join("&"),_method="post",_contentType=AXConfig.AXReq.contentType,_headers={},_responseType=AXConfig.AXReq.responseType,_dataType=AXConfig.AXReq.dataType;return ajax.method&&(_method=ajax.method),ajax.contentType&&(_contentType=ajax.contentType),ajax.headers&&(_headers=ajax.headers),new AXReq(url,{type:_method,contentType:_contentType,responseType:_responseType,dataType:_dataType,headers:_headers,debug:ajax.debug,pars:pars,onsucc:function(res){res.result&&res.result==AXConfig.AXReq.okCode||void 0==res.result&&!res.error?saveEditorRequest(res):(toast.push({body:res.msg.dec(),type:"Caution"}),cancelEditor())},onerr:function(res){if(cfg.editor.response){var sendObj={error:!0,res:res,index:this.editorItemIndex,insertIndex:this.editorInsertIndex,list:this.list,page:this.page};cfg.editor.response.call(sendObj,this.editorItemIndex)}cancelEditor()}}),!0}var saveEditorRequest=this.saveEditorRequest.bind(this),cancelEditor=this.cancelEditor.bind(this);saveEditorRequest({item:editorFormItem})}},saveEditorRequest:function(res){var cfg=this.config;if(this.editorOpend)if(cfg.editor.response){var sendObj={res:res,index:this.editorItemIndex,insertIndex:this.editorInsertIndex,list:this.list,page:this.page};cfg.editor.response.call(sendObj,this.editorItemIndex)}else this.unbindAXbind(),null!=this.editorItemIndex&&void 0!=this.editorItemIndex?(AXUtil.overwriteObject(this.list[this.editorItemIndex],res.item,!0),this.updateList(this.editorItemIndex,this.list[this.editorItemIndex])):null!=this.editorInsertIndex&&void 0!=this.editorInsertIndex?this.pushList(res.item,this.editorInsertIndex):this.pushList(res.item),this.editorItemIndex=null,this.editorInsertIndex=null,this.editor.hide(),this.editorOpend=!1},cancelEditor:function(){this.editor.hide(),this.editorOpend=!1,this.unbindAXbind()},unbindAXbind:function(){var cfg=this.config;try{if(cfg.editor&&cfg.editor.rows)for(var r=0;r0&&CH.AXBind){var formID=CH.form.id?CH.form.id:cfg.targetID+"_AX_"+CH.key+"_AX_"+r+"_AX_"+CHidx;"number"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"money"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"selector"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"slider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"twinSlider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"date"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"twinDate"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"dateTime"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"switch"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"select"==CH.AXBind.type&&"select"==CH.form.type&&axdom("#"+formID).unbindSelect()}})}catch(e){console.log(e)}},appendList:function(item,insertIndex){insertIndex>=this.list.length&&(insertIndex=this.list.length),this.setEditor(item,void 0,insertIndex)},setMobileTool:function(){var cfg=this.config,toolGroupTop=axdom("#"+cfg.targetID+"_AX_gridToolGroupTop"),toolGroupBottom=axdom("#"+cfg.targetID+"_AX_gridToolGroupBottom"),po=[];po.push(''),po.push('congif'),cfg.page&&cfg.page.paging&&(po.push('
'),po.push('prev'),po.push('
'),po.push('next'),po.push("
")),po.push('top'),toolGroupTop.empty(),toolGroupTop.append(po.join("")),po=[],po.push(''),po.push('congif'),cfg.page&&cfg.page.paging&&(po.push('
'),po.push('prev'),po.push('
'),po.push('next'),po.push("
")),po.push('bottom'),toolGroupBottom.empty(),toolGroupBottom.append(po.join(""));var pgCount=this.page.pageCount.number(),pageNo=this.page.pageNo.number();if(cfg.page){if(cfg.page.paging){if(0==pgCount)po=[],po.push(''),axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").html(po.join("")),axdom("#"+cfg.targetID+"_AX_gridToolTopPageNoDisplay").html(po.join("")),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").html(po.join("")),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNoDisplay").html(po.join(""));else{axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").html(""),axdom("#"+cfg.targetID+"_AX_gridToolTopPageNoDisplay").html(pageNo);var mySelect=axf.getId(cfg.targetID+"_AX_gridToolTopPageNo");axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").html(""),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNoDisplay").html(pageNo);for(var mySelectBottom=axf.getId(cfg.targetID+"_AX_gridToolBottomPageNo"),oi=0,p=1;pgCount+1>p;p++)mySelect.options[oi]=new Option(p,p.money()),mySelectBottom.options[oi]=new Option(p,p.money()),pageNo==p&&(mySelect.options[oi].selected=!0,mySelectBottom.options[oi].selected=!0),oi++}axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").bind("change",this.onPageChange.bind(this)),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").bind("change",this.onPageChange.bind(this));var goPageMove=this.goPageMove.bind(this);toolGroupTop.find(".tool-prevPage").bind("click",function(event){goPageMove(-1)}),toolGroupBottom.find(".tool-prevPage").bind("click",function(event){goPageMove(-1)}),toolGroupTop.find(".tool-nextPage").bind("click",function(event){goPageMove(1)}),toolGroupBottom.find(".tool-nextPage").bind("click",function(event){goPageMove(1)})}var openMobileConfig=this.openMobileConfig.bind(this);toolGroupTop.find(".tool-config").bind("click",function(event){openMobileConfig(event)}),toolGroupBottom.find(".tool-config").bind("click",function(event){openMobileConfig(event)})}},setPaging:function(){var cfg=this.config;if("mobile"==cfg.viewMode)return this.setMobileTool(),this;axdom("#"+cfg.targetID+"_AX_gridToolGroupTop").empty(),axdom("#"+cfg.targetID+"_AX_gridToolGroupBottom").empty();var pgCount=(axf.getId(cfg.targetID+"_AX_gridPageNo"),this.page.pageCount.number()),pageNo=this.page.pageNo.number();if(0===pgCount){var po=[];po.push(''),axdom("#"+cfg.targetID+"_AX_gridPageNo").html(po.join(""))}else{axdom("#"+cfg.targetID+"_AX_gridPageNo").html("");var mySelect=axf.getId(cfg.targetID+"_AX_gridPageNo");if(pgCount>1e3){var oi=0,pageStart=1,pageEnd=pageNo+49;pageNo>50&&(pageStart=pageNo-50),pageEnd>pgCount&&(pageEnd=pgCount);for(var p=pageStart;pageEnd+1>p;p++)mySelect.options[oi]=new Option(p,p.money()),pageNo==p&&(mySelect.options[oi].selected=!0),oi++}else for(var oi=0,p=1;pgCount+1>p;p++)mySelect.options[oi]=new Option(p,p.money()),pageNo==p&&(mySelect.options[oi].selected=!0),oi++}if(axdom("#"+cfg.targetID+"_AX_gridPageCount").html("/ "+pgCount.money()+" "+cfg.pageCountMSG),0==this.page.listCount.number()&&(this.page.listCount=this.list.length),axdom("#"+cfg.targetID+"_AX_gridStatus").html(cfg.listCountMSG.replace("{listCount}",this.page.listCount.number().money())),this.isMobile)axdom("#"+cfg.targetID+"_AX_gridPageNo").bind("change",this.onPageChange.bind(this));else{var onPageChange=this.onPageChange.bind(this);axdom("#"+cfg.targetID+"_AX_gridPageNo").bindSelect({onchange:function(arg){onPageChange()}})}},goPageMove:function(pageAdd){var cfg=this.config;if(this.page.pageCount.number()>0){var pgCount=this.page.pageCount.number(),pageNo=this.page.pageNo.number();1>pageNo+pageAdd?pageNo=1:pageNo+pageAdd>pgCount?pageNo=pgCount:pageNo+=pageAdd,"mobile"==cfg.viewMode?(axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").val(pageNo),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").val(pageNo),this.onPageChange()):axdom("#"+cfg.targetID+"_AX_gridPageNo").setValueSelect(pageNo)}},onPageChange:function(e){var pgCount,pageNo,npageNo,cfg=this.config;if(pgCount=this.page.pageCount.number(),pageNo=this.page.pageNo.number(),npageNo="mobile"==cfg.viewMode?e?e.target.value:axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").val():axdom("#"+cfg.targetID+"_AX_gridPageNo").val(),this.page.pageNo=npageNo,this.page.onchange)this.page.onchange.call(this.page,npageNo);else if("mobile"!=cfg.viewMode){var scrollTop=0;this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop}),this.pageActive&&this.ajaxInfo&&(this.setList(this.ajaxInfo,this.ajax_sortDisable,null,"paging"),this.contentScrollResize())}else this.pageActive&&this.ajaxInfo&&this.setList(this.ajaxInfo,this.ajax_sortDisable,null,"paging")},setStatus:function(listLength){var listCount,cfg=this.config;if("undefined"!=typeof listLength)listCount=listLength;else{var page;this.page&&(page=this.page),listCount=page.listCount||0}axdom("#"+cfg.targetID+"_AX_gridStatus").html(cfg.listCountMSG.replace("{listCount}",listCount.number().money()))},getSortParam:function(ty){var sortObj=(this.config,this.nowSortHeadObj);return sortObj?"one"==ty?"sortBy="+sortObj.key+" "+sortObj.sort:axdom.param({sortKey:sortObj.key,sortWay:sortObj.sort}):""},getExcelColHeadTd:function(arg,filter){var cfg=this.config,po=[];return filter&&!filter.call(cfg.colGroup[arg.colSeq])?"":("html"!=arg.formatter&&"checkbox"!=arg.formatter||arg.displayLabel||(colHeadTdText=" colHeadTdHtml",toolUse=!1,"checkbox"==arg.formatter&&(colHeadTdText=" colHeadTdCheck")),po.push(""),po.push(arg.tdHtml),po.push(""),po.join(""))},getExcelItem:function(itemIndex,item,filter){for(var cfg=this.config,tpo=[],_this=this,getTooltipValue=(this.getFormatterValue.bind(this),this.getTooltipValue.bind(this)),r=0;r"),cfg.body.rows[r].forEach(function(CH,CHidx){var result="";if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?" rowspan='"+CH.rowspan+"'":"",colspan=CH.colspan>1?" colspan='"+CH.colspan+"'":"",valign=" valign='"+CH.valign+"' style='vertical-align:"+CH.valign+";mso-number-format:\\@ ;'",tooltipValue="";if(CH.tooltip&&(tooltipValue=getTooltipValue(CH.tooltip,item,itemIndex,item[CH.key],CH.key,CH)),tpo.push(""),CH.formatter){if(Object.isFunction(CH.formatter)){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page,key:CH.key,value:item[CH.key]||""};result=CH.formatter.call(sendObj,itemIndex,item),result=(""+result).delHtml()}else result=Object.isString(CH.formatter)&&CH.formatter in _this.formatter&&"checkbox"==CH.formatter?item[CH.key]:_this.formatter[CH.formatter].call(_this,CH.formatter,item,itemIndex,item[CH.key],CH.key,CH,CHidx);tpo.push(result||"")}else tpo.push(item[CH.key]||"");tpo.push("")}}),tpo.push("");return tpo.join("")},getExcelItemMarker:function(itemIndex,item,isfix,filter,markerIndexs){for(var cfg=this.config,tpo=[],getFormatterValue=this.getFormatterValue.bind(this),mi=0,l=markerIndexs.length;l>mi;mi++)for(var marker=cfg.body.marker[markerIndexs[mi]],r=0;r"),axf.each(marker.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"';tpo.push(""),CH.formatter?tpo.push(getFormatterValue(CH.formatter,item,itemIndex,item[CH.key],CH.key,CH)):tpo.push(item[CH.key]),tpo.push("")}}),tpo.push("")}return tpo.join("")},getExcelHeadDataSet:function(dataSet,isfix,filter){var cfg=this.config;if(void 0!=dataSet){var tpo=[],getDataSetFormatterValue=this.getDataSetFormatterValue.bind(this);axf.each(cfg.colGroup,function(){void 0==dataSet[this.key]&&(dataSet[this.key]="")});for(var r=0;r");axf.each(cfg.head.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bodyNodeClass="";"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push(""),CH.formatter?tpo.push(getDataSetFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH)):tpo.push(dataSet[CH.key]),tpo.push("")}}),tpo.push("")}return tpo.join("")}},getExcelFootDataSet:function(dataSet,isfix,filter){var cfg=this.config;if(void 0!=dataSet){var tpo=[],getDataSetFormatterValue=this.getDataSetFormatterValue.bind(this);axf.each(cfg.colGroup,function(){void 0==dataSet[this.key]&&(dataSet[this.key]="")});for(var r=(this.hasFixed,0);r"),axf.each(cfg.foot.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bodyNodeClass=(CH.isLastCell?"":" bodyBottomBorder",CH.isFixedEndCell?" fixedLine":"","");"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push(""),CH.formatter?tpo.push(getDataSetFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH)):tpo.push(dataSet[CH.key]),tpo.push("")}}),tpo.push("")}return tpo.join("")}},getExcelFormat:function(format,filter){var markerIndex,cfg=this.config,getExcelColHeadTd=this.getExcelColHeadTd.bind(this),bodyHasMarker=this.bodyHasMarker,getExcelItem=this.getExcelItem.bind(this),getExcelItemMarker=this.getExcelItemMarker.bind(this),getMarkerDisplay=this.getMarkerDisplay.bind(this),getHeadDataSet=this.getExcelHeadDataSet.bind(this),getFootDataSet=this.getExcelFootDataSet.bind(this),po=[];if("html"==format){po.push(""),po.push(" ");for(var r=0;r"),axf.each(cfg.colHead.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0){var tdHtml=CH.label||"untitle",rowspan=CH.rowspan>1?" rowspan='"+CH.rowspan+"'":"",colspan=CH.colspan>1?" colspan='"+CH.colspan+"'":"",valign=" valign='"+CH.valign+"'";po.push(getExcelColHeadTd({valign:valign,rowspan:rowspan,colspan:colspan,align:CH.align,colSeq:CH.colSeq,formatter:CH.formatter,sort:CH.sort,tdHtml:tdHtml,displayLabel:CH.displayLabel},filter))}}),po.push("")}return po.push(" "),po.push(" "),cfg.head&&po.push(getHeadDataSet(this.dataSet,!1,filter)),axf.each(this.list,function(itemIndex,item){po.push(getExcelItem(itemIndex,item,filter)),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getExcelItemMarker(itemIndex,item,"n",filter,markerIndex))}),cfg.foot&&po.push(getFootDataSet(this.dataSet,!1,filter)),po.push(" "),po.push("
"),po.join("")}return"json"==format?{colGroup:cfg.colGroup,list:this.list}:void 0},changeGridView:function(JSObject){var cfg=this.config;cfg.viewMode!=JSObject.viewMode&&(cfg.viewMode=JSObject.viewMode,"icon"==JSObject.viewMode?(JSObject.view&&(cfg.view=JSObject.view),this.redrawGrid("changeGridView")):"grid"==JSObject.viewMode?this.redrawGrid("changeGridView"):"mobile"==JSObject.viewMode&&(JSObject.view&&(cfg.view=JSObject.view),this.redrawGrid("changeGridView")))},openMobileConfig:function(event){var cfg=this.config,_this=this,mobileView=cfg.view;if(void 0==mobileView){for(var CG,columns=[],cidx=0,__arr=cfg.colGroup;cidx<__arr.length&&(CG=__arr[cidx]);cidx++){var col=null,addClass="";CG.widthAstric||CG.width.number()>=200?(col=4,addClass="underLine"):CG.width.number()>=100?col=2:CG.width.number()>=40,columns.push({key:CG.key,label:CG.label,col:col,formatter:CG.formatter,addClass:addClass,sort:CG.sort||"",display:CG.display||!0})}columns=columns.sort(function(pItem,nItem){var v1=pItem.col,v2=nItem.col;return v2>v1?1:v1>v2?-1:v1==v2?0:void 0}),mobileView={labelView:!0,column:columns},cfg.view=mobileView}for(var CN,cidx=0,__arr=mobileView.column;cidx<__arr.length&&(CN=__arr[cidx]);cidx++)void 0!=CN.display&&1!=CN.display||(CN.display=!0,CN.checked=!0);var contextMenu=mobileView.column.concat();this.mobileContextMenu.setConfig({responsiveMobile:9e5}),this.mobileContextMenu.bind({id:cfg.targetID+"myContextMenu",theme:"AXContextMenu",width:"150",checkbox:"checkbox",sortbox:!0,menu:contextMenu,onchange:function(){for(var CN,cidx=0,__arr=this.menu;cidx<__arr.length&&(CN=__arr[cidx]);cidx++)CN.display=CN.checked;cfg.view.column=axf.copyObject(this.menu),_this.printList(),this.contentScrollResize()},onsort:function(){return _this.list=_this.sortList(this.sortMenu.sort,this.sortMenu,_this.list),_this.printList(),this.contentScrollResize(),!0}}),this.mobileContextMenu.open({id:cfg.targetID+"myContextMenu"},event)},clipBoardClear:function(){var body=this.body;return axf.each(this.copiedRow,function(){body.find(".gridBodyTr_"+this).removeClass("copied")}),this.copiedRow.clear(),this.clipBoard.type="",this.clipBoard.list=[],this},selectClear:function(){var body=this.body;return this.selectedCells.length>0&&(axf.each(this.selectedCells,function(){body.find(".bodyTd_"+this).removeClass("selected")}),this.selectedCells.clear()),this.selectedRow.length>0&&(axf.each(this.selectedRow,function(){body.find(".gridBodyTr_"+this).removeClass("selected")}),this.selectedRow.clear()),this.copiedRow.length>0&&(axf.each(this.copiedRow,function(){body.find(".gridBodyTr_"+this).removeClass("copied")}),this.copiedRow.clear()),this.clipBoard.type="",this.clipBoard.list=[],this},getCheckedParams:function(colSeq,traditional){var colName=this.config.colGroup[colSeq].key,checkedList=this.getCheckedList(colSeq),params=[];return colName?checkedList&&0!==checkedList.length?($.each(checkedList,function(idx,item){if(traditional){var p={};p[colName]=item[colName]||"",params.push(p)}else params.push({name:colName,value:item[colName]||""})}),params):params:(console.log("colSeq invalid. Please check the colSeq value."),params)},getList:function(filter,clone){var filteredList=[];if(filter===!1||Object.isUndefined(filter))filteredList=this.list,clone=!1;else if(filter===!0)filteredList=this.list,clone=!0;else if(Object.isString(filter))axf.each(this.list,function(idx,item){filter.indexOf(item._CUD)>-1&&filteredList.push(item)}),filter.indexOf("D")>-1&&axf.each(this.removedList,function(idx,item){filteredList.push(item)});else if(Object.isFunction(filter)){var fnFilter=filter.bind(this);axf.each(this.list,function(idx,item){fnFilter(idx,item)&&filteredList.push(item)})}if(clone){var clonedList=[];return axf.each(filteredList,function(idx,item){clonedList.push(Object.clone(item))}),clonedList}return filteredList},validateCheck:function(filter){var cfg=this.config,_self=this;if(Object.isString(filter)){if(!cfg.colGroup)return!1;var item,editorItem,__arr=cfg.colGroup,arrKeyEditor={};for(var i in __arr)if(item=__arr[i],editorItem=item.editor,Object.isObject(editorItem)){var validateflag=!1;Object.isUndefined(editorItem.notEmpty)||(validateflag=!0,item.editor.notEmpty=editorItem.notEmpty===!0?item.label+" 필수 입력항목입니다.":Object.isString(editorItem.notEmpty)?editorItem.notEmpty:!1),Object.isUndefined(editorItem.range)||(validateflag=!0,item.editor.range.msg=Object.isUndefined(item.editor.range.msg)?item.label+" 입력 값을 초과 하였습니다.":item.editor.range.msg),validateflag&&(arrKeyEditor[i]={},arrKeyEditor[i].editor=item.editor,arrKeyEditor[i].key=item.key)}var _colseq,_idx,reval=!0;axf.each(this.list,function(idx,item){if(filter.indexOf(item._CUD)>-1){var itemval;for(var colseq in arrKeyEditor){if(editorItem=arrKeyEditor[colseq].editor,itemval=item[arrKeyEditor[colseq].key],_colseq=colseq,_idx=idx,editorItem.notEmpty&&""==$.trim(itemval))return editorItem.notEmpty&&alert(editorItem.notEmpty),reval=!1,!1;if(itemval=itemval?itemval+"":"money"!=editorItem.type?"":"0","money"==editorItem.type&&editorItem.range){var rangeval=editorItem.range.val,rangeArr=rangeval.split(","),decimalNum=rangeArr[0],decimalPoint=rangeArr.length>1?rangeArr[1]:0,numval="",pointval="";if(decimalNum=isNaN(decimalNum)?0:parseInt(decimalNum,10),decimalPoint=isNaN(decimalPoint)?0:parseInt(decimalPoint,10),numval=itemval.replace(/[$,]+/g,""),isNaN(numval))return alert("숫자만 입력가능합니다."),reval=!1,!1;if(itemval.indexOf(".")>-1){var valArr=itemval.split(".");numval=valArr[0],pointval=valArr[1]}if((numval.length>decimalNum||pointval.length>decimalPoint)&&editorItem.range.msg)return editorItem.range.msg&&alert(editorItem.range.msg+"\n"+itemval),reval=!1,!1}}}}),reval===!1&&(_self.editCell(0,_colseq,_idx),_self.setFocus(_idx),_self.scrollTop(_idx))}return reval},onevent_grid:function(){},clearSort:function(){var cfg=this.config,rows=cfg.colHead.rows,sort="",removeTg="";$.each(rows,function(idx,o){""==sort&&$.each(o,function(idx_idx,o_o){return void 0!=o_o.sort?(sort=o_o.sort,delete o_o.sort,!1):void 0})}),""!=sort&&("desc"==sort?removeTg="sortDesc":"asc"==sort&&(removeTg="sortAsc"),document.getElementById(this.nowSortHeadID).classList.remove(removeTg),this.nowSortHeadObj=void 0,this.nowSortHeadID=void 0)},reorderColGroup:function(rColgroup){var cfg=this.config,oldColGroup=[].concat(cfg.colGroup),newColGroup=[];return rColgroup&&(rColgroup.forEach(function(c){jQuery.each(oldColGroup,function(idx,oc){return oc.key==c.key?(delete oc.colSeq,newColGroup.push(oc),oldColGroup.splice(idx,1),!1):void 0})}),cfg.colGroup=newColGroup.concat(oldColGroup),function(){for(var oldBodyRows=[],r=0;rm;m++)convertMarker(cfg.body.marker[m]);else convertMarker(cfg.body.marker)}.call(this),function(){if(cfg.foot){for(var oldFootRows=[],r=0;r0){var formID="";CH.AXBind&&(formID=CH.form.id?CH.form.id:cfg.targetID+"_AX_"+CH.key+"_AX_"+r+"_AX_"+CHidx,"number"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindNumber(CH.AXBind.config||{}):"money"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindMoney(CH.AXBind.config||{}):"selector"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindSelector(CH.AXBind.config||{}):"slider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindSlider(CH.AXBind.config||{}):"twinSlider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindTwinSlider(CH.AXBind.config||{}):"date"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindDate(CH.AXBind.config||{}):"twinDate"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindTwinDate(CH.AXBind.config||{}):"dateTime"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindDateTime(CH.AXBind.config||{}):"switch"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).bindSwitch(CH.AXBind.config||{}):"select"==CH.AXBind.type&&"select"==CH.form.type&&axdom("#"+formID).bindSelect(CH.AXBind.config||{})),CH.form&&(formID=CH.form.id?CH.form.id:cfg.targetID+"_AX_"+CH.key+"_AX_"+r+"_AX_"+CHidx,CH.form.onChange&&axdom("#"+formID).bind("change",function(){CH.form.onChange.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val(),text:axf.getId(formID).options[axf.getId(formID).options.selectedIndex].text})}),CH.form.onClick&&axdom("#"+formID).bind("click",function(){CH.form.onClick.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val()})}),CH.form.onBlur&&axdom("#"+formID).bind("blur",function(){CH.form.onBlur.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val()})}),CH.form.onFocus&&axdom("#"+formID).bind("focus",function(){CH.form.onFocus.call({key:CH.key,position:CHidx,value:axdom("#"+formID).val()})}))}});var editorContent=axdom("#"+cfg.targetID+"_AX_editorContent"),fixedEditorContent=axdom("#"+cfg.targetID+"_AX_fixedEditorContent"),editorButtons=axdom("#"+cfg.targetID+"_AX_editorButtons"),editorContentHeight=editorContent.height(),fixedEditorContentHeight=fixedEditorContent.height();fixedEditorContentHeight>editorContentHeight?(editorContentHeight=fixedEditorContentHeight,editorContent.find(".gridBodyTable").css({height:editorContentHeight})):fixedEditorContent.find(".gridFixedBodyTable").css({height:editorContentHeight}),editorButtons.css({top:editorContentHeight});editorContentHeight.number();itemTrHeight>editorContentHeight&&(editorContentHeight=itemTrHeight,editorContent.find(".gridBodyTable").css({height:editorContentHeight}),fixedEditorContent.find(".gridFixedBodyTable").css({height:editorContentHeight}),this.editor.css({height:editorContentHeight.number()}),editorButtons.css({top:editorContentHeight}));var scrollLeft=this.scrollContent.position().left;editorContent.css({left:scrollLeft}),"top"==this.editorButtonPosition&&(void 0!=insertIndex?this.editor.css({top:this.editor.position().top-editorContentHeight}):this.editor.css({top:this.editor.position().top-editorContentHeight+itemTrHeight}),editorButtons.addClass("top"),editorButtons.css({top:-editorButtons.outerHeight()+1})),axdom("#"+cfg.targetID+"_AX_editorButtons_AX_save").bind("click",this.saveEditor.bind(this)),axdom("#"+cfg.targetID+"_AX_editorButtons_AX_cancel").bind("click",this.cancelEditor.bind(this))},setEditorForm:function(obj){var cfg=this.config,formID=cfg.targetID+"_AX_"+obj.key+"_AX_"+obj.position.join("_AX_");axf.getId(formID)||alert(formID+"로 Element를 찾을 수 없습니다."),axdom("#"+formID).val(obj.value)},focusEditorForm:function(key){this.config;this.editor.find("input[type=text],textarea").each(function(){return this.name==key?(this.focus(),!1):void 0})},saveEditor:function(){var cfg=this.config,editorFormItem={};null==this.editorItemIndex?editorFormItem.requestType="new":editorFormItem.requestType="edit";for(var setEditorFormItemValue=function(k,v,type){editorFormItem[k]&&"checkbox"==type?Object.isArray(editorFormItem[k])?editorFormItem[k].push(v):(editorFormItem[k]=[editorFormItem[k]],editorFormItem[k].push(v)):editorFormItem[k]=v},r=0;r'),po.push('
'),po.push(""),this.editor.html(po.join(""));var saveEditorRequest=this.saveEditorRequest.bind(this),cancelEditor=this.cancelEditor.bind(this),ajax=cfg.editor.request,url=ajax.ajaxUrl,formPars=[];axf.each(editorFormItem,function(k,v){formPars.push(k+"="+v.enc())}),Object.isString(obj.ajaxPars)?formPars.push(obj.ajaxPars):Object.isObject(obj.ajaxPars)&&formPars.push(axdom.param(obj.ajaxPars));var pars=formPars.join("&"),_method="post",_contentType=AXConfig.AXReq.contentType,_headers={},_responseType=AXConfig.AXReq.responseType,_dataType=AXConfig.AXReq.dataType;return ajax.method&&(_method=ajax.method),ajax.contentType&&(_contentType=ajax.contentType),ajax.headers&&(_headers=ajax.headers),new AXReq(url,{type:_method,contentType:_contentType,responseType:_responseType,dataType:_dataType,headers:_headers,debug:ajax.debug,pars:pars,onsucc:function(res){res.result&&res.result==AXConfig.AXReq.okCode||void 0==res.result&&!res.error?saveEditorRequest(res):(toast.push({body:res.msg.dec(),type:"Caution"}),cancelEditor())},onerr:function(res){if(cfg.editor.response){var sendObj={error:!0,res:res,index:this.editorItemIndex,insertIndex:this.editorInsertIndex,list:this.list,page:this.page};cfg.editor.response.call(sendObj,this.editorItemIndex)}cancelEditor()}}),!0}var saveEditorRequest=this.saveEditorRequest.bind(this),cancelEditor=this.cancelEditor.bind(this);saveEditorRequest({item:editorFormItem})}},saveEditorRequest:function(res){var cfg=this.config;if(this.editorOpend)if(cfg.editor.response){var sendObj={res:res,index:this.editorItemIndex,insertIndex:this.editorInsertIndex,list:this.list,page:this.page};cfg.editor.response.call(sendObj,this.editorItemIndex)}else this.unbindAXbind(),null!=this.editorItemIndex&&void 0!=this.editorItemIndex?(AXUtil.overwriteObject(this.list[this.editorItemIndex],res.item,!0),this.updateList(this.editorItemIndex,this.list[this.editorItemIndex])):null!=this.editorInsertIndex&&void 0!=this.editorInsertIndex?this.pushList(res.item,this.editorInsertIndex):this.pushList(res.item),this.editorItemIndex=null,this.editorInsertIndex=null,this.editor.hide(),this.editorOpend=!1},cancelEditor:function(){this.editor.hide(),this.editorOpend=!1,this.unbindAXbind()},unbindAXbind:function(){var cfg=this.config;try{if(cfg.editor&&cfg.editor.rows)for(var r=0;r0&&CH.AXBind){var formID=CH.form.id?CH.form.id:cfg.targetID+"_AX_"+CH.key+"_AX_"+r+"_AX_"+CHidx;"number"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"money"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"selector"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"slider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"twinSlider"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"date"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"twinDate"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"dateTime"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"switch"==CH.AXBind.type&&"text"==CH.form.type?axdom("#"+formID).unbindInput():"select"==CH.AXBind.type&&"select"==CH.form.type&&axdom("#"+formID).unbindSelect()}})}catch(e){console.log(e)}},appendList:function(item,insertIndex){insertIndex>=this.list.length&&(insertIndex=this.list.length),this.setEditor(item,void 0,insertIndex)},setMobileTool:function(){var cfg=this.config,toolGroupTop=axdom("#"+cfg.targetID+"_AX_gridToolGroupTop"),toolGroupBottom=axdom("#"+cfg.targetID+"_AX_gridToolGroupBottom"),po=[];po.push(''),po.push('congif'),cfg.page&&cfg.page.paging&&(po.push('
'),po.push('prev'),po.push('
'),po.push('next'),po.push("
")),po.push('top'),toolGroupTop.empty(),toolGroupTop.append(po.join("")),po=[],po.push(''),po.push('congif'),cfg.page&&cfg.page.paging&&(po.push('
'),po.push('prev'),po.push('
'),po.push('next'),po.push("
")),po.push('bottom'),toolGroupBottom.empty(),toolGroupBottom.append(po.join(""));var pgCount=this.page.pageCount.number(),pageNo=this.page.pageNo.number();if(cfg.page){if(cfg.page.paging){if(0==pgCount)po=[],po.push(''),axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").html(po.join("")),axdom("#"+cfg.targetID+"_AX_gridToolTopPageNoDisplay").html(po.join("")),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").html(po.join("")),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNoDisplay").html(po.join(""));else{axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").html(""),axdom("#"+cfg.targetID+"_AX_gridToolTopPageNoDisplay").html(pageNo);var mySelect=axf.getId(cfg.targetID+"_AX_gridToolTopPageNo");axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").html(""),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNoDisplay").html(pageNo);for(var mySelectBottom=axf.getId(cfg.targetID+"_AX_gridToolBottomPageNo"),oi=0,p=1;pgCount+1>p;p++)mySelect.options[oi]=new Option(p,p.money()),mySelectBottom.options[oi]=new Option(p,p.money()),pageNo==p&&(mySelect.options[oi].selected=!0,mySelectBottom.options[oi].selected=!0),oi++}axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").bind("change",this.onPageChange.bind(this)),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").bind("change",this.onPageChange.bind(this));var goPageMove=this.goPageMove.bind(this);toolGroupTop.find(".tool-prevPage").bind("click",function(event){goPageMove(-1)}),toolGroupBottom.find(".tool-prevPage").bind("click",function(event){goPageMove(-1)}),toolGroupTop.find(".tool-nextPage").bind("click",function(event){goPageMove(1)}),toolGroupBottom.find(".tool-nextPage").bind("click",function(event){goPageMove(1)})}var openMobileConfig=this.openMobileConfig.bind(this);toolGroupTop.find(".tool-config").bind("click",function(event){openMobileConfig(event)}),toolGroupBottom.find(".tool-config").bind("click",function(event){openMobileConfig(event)})}},setPaging:function(){var cfg=this.config;if("mobile"==cfg.viewMode)return this.setMobileTool(),this;axdom("#"+cfg.targetID+"_AX_gridToolGroupTop").empty(),axdom("#"+cfg.targetID+"_AX_gridToolGroupBottom").empty();var pgCount=(axf.getId(cfg.targetID+"_AX_gridPageNo"),this.page.pageCount.number()),pageNo=this.page.pageNo.number();if(0===pgCount){var po=[];po.push(''),axdom("#"+cfg.targetID+"_AX_gridPageNo").html(po.join(""))}else{axdom("#"+cfg.targetID+"_AX_gridPageNo").html("");var mySelect=axf.getId(cfg.targetID+"_AX_gridPageNo");if(pgCount>1e3){var oi=0,pageStart=1,pageEnd=pageNo+49;pageNo>50&&(pageStart=pageNo-50),pageEnd>pgCount&&(pageEnd=pgCount);for(var p=pageStart;pageEnd+1>p;p++)mySelect.options[oi]=new Option(p,p.money()),pageNo==p&&(mySelect.options[oi].selected=!0),oi++}else for(var oi=0,p=1;pgCount+1>p;p++)mySelect.options[oi]=new Option(p,p.money()),pageNo==p&&(mySelect.options[oi].selected=!0),oi++}if(axdom("#"+cfg.targetID+"_AX_gridPageCount").html("/ "+pgCount.money()+" "+cfg.pageCountMSG),0==this.page.listCount.number()&&(this.page.listCount=this.list.length),axdom("#"+cfg.targetID+"_AX_gridStatus").html(cfg.listCountMSG.replace("{listCount}",this.page.listCount.number().money())),this.isMobile)axdom("#"+cfg.targetID+"_AX_gridPageNo").bind("change",this.onPageChange.bind(this));else{var onPageChange=this.onPageChange.bind(this);axdom("#"+cfg.targetID+"_AX_gridPageNo").bindSelect({onchange:function(arg){onPageChange()}})}},goPageMove:function(pageAdd){var cfg=this.config;if(this.page.pageCount.number()>0){var pgCount=this.page.pageCount.number(),pageNo=this.page.pageNo.number();if(1>pageNo+pageAdd)return!1;if(pageNo+pageAdd>pgCount)return!1;pageNo+=pageAdd,"mobile"==cfg.viewMode?(axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").val(pageNo),axdom("#"+cfg.targetID+"_AX_gridToolBottomPageNo").val(pageNo),this.onPageChange()):axdom("#"+cfg.targetID+"_AX_gridPageNo").setValueSelect(pageNo)}},onPageChange:function(e){var pgCount,pageNo,npageNo,cfg=this.config;if(pgCount=this.page.pageCount.number(),pageNo=this.page.pageNo.number(),npageNo="mobile"==cfg.viewMode?e?e.target.value:axdom("#"+cfg.targetID+"_AX_gridToolTopPageNo").val():axdom("#"+cfg.targetID+"_AX_gridPageNo").val(),this.page.pageNo=npageNo,this.page.onchange)this.page.onchange.call(this.page,npageNo);else if("mobile"!=cfg.viewMode){var scrollTop=0;this.scrollContent.css({top:scrollTop}),this.contentScrollContentSync({top:scrollTop}),this.pageActive&&this.ajaxInfo&&(this.setList(this.ajaxInfo,this.ajax_sortDisable,null,"paging"),this.contentScrollResize())}else this.pageActive&&this.ajaxInfo&&this.setList(this.ajaxInfo,this.ajax_sortDisable,null,"paging")},setStatus:function(listLength){var listCount,cfg=this.config;if("undefined"!=typeof listLength)listCount=listLength;else{var page;this.page&&(page=this.page),listCount=page.listCount||0}axdom("#"+cfg.targetID+"_AX_gridStatus").html(cfg.listCountMSG.replace("{listCount}",listCount.number().money()))},getSortParam:function(ty){var sortObj=(this.config,this.nowSortHeadObj);return sortObj?"one"==ty?"sortBy="+sortObj.key+" "+sortObj.sort:axdom.param({sortKey:sortObj.key,sortWay:sortObj.sort}):""},getExcelColHeadTd:function(arg,filter){var cfg=this.config,po=[];return filter&&!filter.call(cfg.colGroup[arg.colSeq])?"":("html"!=arg.formatter&&"checkbox"!=arg.formatter||arg.displayLabel||(colHeadTdText=" colHeadTdHtml",toolUse=!1,"checkbox"==arg.formatter&&(colHeadTdText=" colHeadTdCheck")),po.push(""),po.push(arg.tdHtml),po.push(""),po.join(""))},getExcelItem:function(itemIndex,item,filter){for(var cfg=this.config,tpo=[],_this=this,getTooltipValue=(this.getFormatterValue.bind(this),this.getTooltipValue.bind(this)),r=0;r"),cfg.body.rows[r].forEach(function(CH,CHidx){var result="";if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?" rowspan='"+CH.rowspan+"'":"",colspan=CH.colspan>1?" colspan='"+CH.colspan+"'":"",valign=" valign='"+CH.valign+"' style='vertical-align:"+CH.valign+";mso-number-format:\\@ ;'",tooltipValue="";if(CH.tooltip&&(tooltipValue=getTooltipValue(CH.tooltip,item,itemIndex,item[CH.key],CH.key,CH)),tpo.push(""),CH.formatter){if(Object.isFunction(CH.formatter)){var sendObj={index:itemIndex,list:this.list,item:item,page:this.page,key:CH.key,value:item[CH.key]||""};result=CH.formatter.call(sendObj,itemIndex,item),result=(""+result).delHtml()}else result=Object.isString(CH.formatter)&&CH.formatter in _this.formatter&&"checkbox"==CH.formatter?item[CH.key]:_this.formatter[CH.formatter].call(_this,CH.formatter,item,itemIndex,item[CH.key],CH.key,CH,CHidx);tpo.push(result||"")}else tpo.push(item[CH.key]||"");tpo.push("")}}),tpo.push("");return tpo.join("")},getExcelItemMarker:function(itemIndex,item,isfix,filter,markerIndexs){for(var cfg=this.config,tpo=[],getFormatterValue=this.getFormatterValue.bind(this),mi=0,l=markerIndexs.length;l>mi;mi++)for(var marker=cfg.body.marker[markerIndexs[mi]],r=0;r"),axf.each(marker.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"';tpo.push(""),CH.formatter?tpo.push(getFormatterValue(CH.formatter,item,itemIndex,item[CH.key],CH.key,CH)):tpo.push(item[CH.key]),tpo.push("")}}),tpo.push("")}return tpo.join("")},getExcelHeadDataSet:function(dataSet,isfix,filter){var cfg=this.config;if(void 0!=dataSet){var tpo=[],getDataSetFormatterValue=this.getDataSetFormatterValue.bind(this);axf.each(cfg.colGroup,function(){void 0==dataSet[this.key]&&(dataSet[this.key]="")});for(var r=0;r");axf.each(cfg.head.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bodyNodeClass="";"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push(""),CH.formatter?tpo.push(getDataSetFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH)):tpo.push(dataSet[CH.key]),tpo.push("")}}),tpo.push("")}return tpo.join("")}},getExcelFootDataSet:function(dataSet,isfix,filter){var cfg=this.config;if(void 0!=dataSet){var tpo=[],getDataSetFormatterValue=this.getDataSetFormatterValue.bind(this);axf.each(cfg.colGroup,function(){void 0==dataSet[this.key]&&(dataSet[this.key]="")});for(var r=(this.hasFixed,0);r"),axf.each(cfg.foot.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0)if(filter&&!filter.call(CH));else{var rowspan=CH.rowspan>1?' rowspan="'+CH.rowspan+'"':"",colspan=CH.colspan>1?' colspan="'+CH.colspan+'"':"",valign=' valign="'+CH.valign+'" style="vertical-align:'+CH.valign+';"',bodyNodeClass=(CH.isLastCell?"":" bodyBottomBorder",CH.isFixedEndCell?" fixedLine":"","");"checkbox"==CH.formatter||"radio"==CH.formatter?bodyNodeClass=" bodyTdCheckBox":"html"==CH.formatter&&(bodyNodeClass=" bodyTdHtml"),tpo.push(""),CH.formatter?tpo.push(getDataSetFormatterValue(CH.formatter,dataSet,dataSet[CH.key],CH.key,CH)):tpo.push(dataSet[CH.key]),tpo.push("")}}),tpo.push("")}return tpo.join("")}},getExcelFormat:function(format,filter){var markerIndex,cfg=this.config,getExcelColHeadTd=this.getExcelColHeadTd.bind(this),bodyHasMarker=this.bodyHasMarker,getExcelItem=this.getExcelItem.bind(this),getExcelItemMarker=this.getExcelItemMarker.bind(this),getMarkerDisplay=this.getMarkerDisplay.bind(this),getHeadDataSet=this.getExcelHeadDataSet.bind(this),getFootDataSet=this.getExcelFootDataSet.bind(this),po=[];if("html"==format){po.push(""),po.push(" ");for(var r=0;r"),axf.each(cfg.colHead.rows[r],function(CHidx,CH){if(CH.display&&CH.colspan>0){var tdHtml=CH.label||"untitle",rowspan=CH.rowspan>1?" rowspan='"+CH.rowspan+"'":"",colspan=CH.colspan>1?" colspan='"+CH.colspan+"'":"",valign=" valign='"+CH.valign+"'";po.push(getExcelColHeadTd({valign:valign,rowspan:rowspan,colspan:colspan,align:CH.align,colSeq:CH.colSeq,formatter:CH.formatter,sort:CH.sort,tdHtml:tdHtml,displayLabel:CH.displayLabel},filter))}}),po.push("")}return po.push(" "),po.push(" "),cfg.head&&po.push(getHeadDataSet(this.dataSet,!1,filter)),axf.each(this.list,function(itemIndex,item){po.push(getExcelItem(itemIndex,item,filter)),bodyHasMarker&&(markerIndex=getMarkerDisplay(itemIndex,item)).length>0&&po.push(getExcelItemMarker(itemIndex,item,"n",filter,markerIndex))}),cfg.foot&&po.push(getFootDataSet(this.dataSet,!1,filter)),po.push(" "),po.push("
"),po.join("")}return"json"==format?{colGroup:cfg.colGroup,list:this.list}:void 0},changeGridView:function(JSObject){var cfg=this.config;cfg.viewMode!=JSObject.viewMode&&(cfg.viewMode=JSObject.viewMode,"icon"==JSObject.viewMode?(JSObject.view&&(cfg.view=JSObject.view),this.redrawGrid("changeGridView")):"grid"==JSObject.viewMode?this.redrawGrid("changeGridView"):"mobile"==JSObject.viewMode&&(JSObject.view&&(cfg.view=JSObject.view),this.redrawGrid("changeGridView")))},openMobileConfig:function(event){var cfg=this.config,_this=this,mobileView=cfg.view;if(void 0==mobileView){for(var CG,columns=[],cidx=0,__arr=cfg.colGroup;cidx<__arr.length&&(CG=__arr[cidx]);cidx++){var col=null,addClass="";CG.widthAstric||CG.width.number()>=200?(col=4,addClass="underLine"):CG.width.number()>=100?col=2:CG.width.number()>=40,columns.push({key:CG.key,label:CG.label,col:col,formatter:CG.formatter,addClass:addClass,sort:CG.sort||"",display:CG.display||!0})}columns=columns.sort(function(pItem,nItem){var v1=pItem.col,v2=nItem.col;return v2>v1?1:v1>v2?-1:v1==v2?0:void 0}),mobileView={labelView:!0,column:columns},cfg.view=mobileView}for(var CN,cidx=0,__arr=mobileView.column;cidx<__arr.length&&(CN=__arr[cidx]);cidx++)void 0!=CN.display&&1!=CN.display||(CN.display=!0,CN.checked=!0);var contextMenu=mobileView.column.concat();this.mobileContextMenu.setConfig({responsiveMobile:9e5}),this.mobileContextMenu.bind({id:cfg.targetID+"myContextMenu",theme:"AXContextMenu",width:"150",checkbox:"checkbox",sortbox:!0,menu:contextMenu,onchange:function(){for(var CN,cidx=0,__arr=this.menu;cidx<__arr.length&&(CN=__arr[cidx]);cidx++)CN.display=CN.checked;cfg.view.column=axf.copyObject(this.menu),_this.printList(),this.contentScrollResize()},onsort:function(){return _this.list=_this.sortList(this.sortMenu.sort,this.sortMenu,_this.list),_this.printList(),this.contentScrollResize(),!0}}),this.mobileContextMenu.open({id:cfg.targetID+"myContextMenu"},event)},clipBoardClear:function(){var body=this.body;return axf.each(this.copiedRow,function(){body.find(".gridBodyTr_"+this).removeClass("copied")}),this.copiedRow.clear(),this.clipBoard.type="",this.clipBoard.list=[],this},selectClear:function(){var body=this.body;return this.selectedCells.length>0&&(axf.each(this.selectedCells,function(){body.find(".bodyTd_"+this).removeClass("selected")}),this.selectedCells.clear()),this.selectedRow.length>0&&(axf.each(this.selectedRow,function(){body.find(".gridBodyTr_"+this).removeClass("selected")}),this.selectedRow.clear()),this.copiedRow.length>0&&(axf.each(this.copiedRow,function(){body.find(".gridBodyTr_"+this).removeClass("copied")}),this.copiedRow.clear()),this.clipBoard.type="",this.clipBoard.list=[],this},getCheckedParams:function(colSeq,traditional){var colName=this.config.colGroup[colSeq].key,checkedList=this.getCheckedList(colSeq),params=[];return colName?checkedList&&0!==checkedList.length?($.each(checkedList,function(idx,item){if(traditional){var p={};p[colName]=item[colName]||"",params.push(p)}else params.push({name:colName,value:item[colName]||""})}),params):params:(console.log("colSeq invalid. Please check the colSeq value."),params)},getList:function(filter,clone){var filteredList=[];if(filter===!1||Object.isUndefined(filter))filteredList=this.list,clone=!1;else if(filter===!0)filteredList=this.list,clone=!0;else if(Object.isString(filter))axf.each(this.list,function(idx,item){filter.indexOf(item._CUD)>-1&&filteredList.push(item)}),filter.indexOf("D")>-1&&axf.each(this.removedList,function(idx,item){filteredList.push(item)});else if(Object.isFunction(filter)){var fnFilter=filter.bind(this);axf.each(this.list,function(idx,item){fnFilter(idx,item)&&filteredList.push(item)})}if(clone){var clonedList=[];return axf.each(filteredList,function(idx,item){clonedList.push(Object.clone(item))}),clonedList}return filteredList},validateCheck:function(filter){var cfg=this.config,_self=this;if(Object.isString(filter)){if(!cfg.colGroup)return!1;var item,editorItem,__arr=cfg.colGroup,arrKeyEditor={};for(var i in __arr)if(item=__arr[i],editorItem=item.editor,Object.isObject(editorItem)){var validateflag=!1;Object.isUndefined(editorItem.notEmpty)||(validateflag=!0,item.editor.notEmpty=editorItem.notEmpty===!0?item.label+" 필수 입력항목입니다.":Object.isString(editorItem.notEmpty)?editorItem.notEmpty:!1),Object.isUndefined(editorItem.range)||(validateflag=!0,item.editor.range.msg=Object.isUndefined(item.editor.range.msg)?item.label+" 입력 값을 초과 하였습니다.":item.editor.range.msg),validateflag&&(arrKeyEditor[i]={},arrKeyEditor[i].editor=item.editor,arrKeyEditor[i].key=item.key)}var _colseq,_idx,reval=!0;axf.each(this.list,function(idx,item){if(filter.indexOf(item._CUD)>-1){var itemval;for(var colseq in arrKeyEditor){if(editorItem=arrKeyEditor[colseq].editor,itemval=item[arrKeyEditor[colseq].key],_colseq=colseq,_idx=idx,editorItem.notEmpty&&""==$.trim(itemval))return editorItem.notEmpty&&alert(editorItem.notEmpty),reval=!1,!1;if(itemval=itemval?itemval+"":"money"!=editorItem.type?"":"0","money"==editorItem.type&&editorItem.range){var rangeval=editorItem.range.val,rangeArr=rangeval.split(","),decimalNum=rangeArr[0],decimalPoint=rangeArr.length>1?rangeArr[1]:0,numval="",pointval="";if(decimalNum=isNaN(decimalNum)?0:parseInt(decimalNum,10),decimalPoint=isNaN(decimalPoint)?0:parseInt(decimalPoint,10),numval=itemval.replace(/[$,]+/g,""),isNaN(numval))return alert("숫자만 입력가능합니다."),reval=!1,!1;if(itemval.indexOf(".")>-1){var valArr=itemval.split(".");numval=valArr[0],pointval=valArr[1]}if((numval.length>decimalNum||pointval.length>decimalPoint)&&editorItem.range.msg)return editorItem.range.msg&&alert(editorItem.range.msg+"\n"+itemval),reval=!1,!1}}}}),reval===!1&&(_self.editCell(0,_colseq,_idx),_self.setFocus(_idx),_self.scrollTop(_idx))}return reval},onevent_grid:function(){},clearSort:function(){var cfg=this.config,rows=cfg.colHead.rows,sort="",removeTg="";$.each(rows,function(idx,o){""==sort&&$.each(o,function(idx_idx,o_o){return void 0!=o_o.sort?(sort=o_o.sort,delete o_o.sort,!1):void 0})}),""!=sort&&("desc"==sort?removeTg="sortDesc":"asc"==sort&&(removeTg="sortAsc"),document.getElementById(this.nowSortHeadID).classList.remove(removeTg),this.nowSortHeadObj=void 0,this.nowSortHeadID=void 0)},reorderColGroup:function(rColgroup){var cfg=this.config,oldColGroup=[].concat(cfg.colGroup),newColGroup=[];return rColgroup&&(rColgroup.forEach(function(c){jQuery.each(oldColGroup,function(idx,oc){return oc.key==c.key?(delete oc.colSeq,newColGroup.push(oc),oldColGroup.splice(idx,1),!1):void 0})}),cfg.colGroup=newColGroup.concat(oldColGroup),function(){for(var oldBodyRows=[],r=0;rm;m++)convertMarker(cfg.body.marker[m]);else convertMarker(cfg.body.marker)}.call(this),function(){if(cfg.foot){for(var oldFootRows=[],r=0;r'}return{wordwrap:function(formatter,item,itemIndex,value,key,CH,CHidx){return value?''+value.dec().crlf().replace(/ /g," ")+"":""},money:function(formatter,item,itemIndex,value,key,CH,CHidx){return""==value||"null"==value||null==value||void 0==value?"0":(value||0).number().money()},dec:function(formatter,item,itemIndex,value,key,CH,CHidx){return void 0==value?"":value.toString().dec()},html:function(formatter,item,itemIndex,value,key,CH,CHidx){return value},checkbox:boxFormatter,radio:boxFormatter,select:function(formatter,item,itemIndex,value,key,CH,CHidx){var txtKey=CH.editor.optionText,valKey=CH.editor.optionValue,options=CH.editor.options||[],text="";if(!txtKey&&AXConfig&&AXConfig.AXSelect&&AXConfig.AXSelect.keyOptionText&&(txtKey=AXConfig.AXSelect.keyOptionText||"optionText"),!valKey&&AXConfig&&AXConfig.AXSelect&&AXConfig.AXSelect.keyOptionValue&&(valKey=AXConfig.AXSelect.keyOptionValue||"optionValue"),0===options.length)return text;for(var isObjectVal=Object.isObject(value),optionVal=isObjectVal?value[valKey]:value,i=0;i-1?{value:obj.tg.options[obj.tg.selectedIndex].value,text:obj.tg.options[obj.tg.selectedIndex].text}:{value:"",text:""};this.loadSucc(robj)},setInputOption:function(obj,selectValue){var config=this.config;obj.tg.empty();var po=[],robj={value:"",text:""};this.ids=obj.ds,axdom.each(obj.ds,function(index,n){config.title?po.push('"),po.push(n.text.dec()+" ")}),obj.tg.html(po.join("")),this.loadSucc(robj),axdom("#"+config.target).find("input").unbind("click",this.onchange2.bind(this)),axdom("#"+config.target).find("input").bind("click",this.onchange2.bind(this))},loadSucc:function(obj){var config=this.config;config.onLoad&&config.onLoad({target:config.target,value:obj.value,text:obj.text})},onchange:function(event){var tg=event.target,config=this.config;config.onChange&&config.onChange({target:config.target,value:tg.options[tg.selectedIndex].value,text:tg.options[tg.selectedIndex].text})},onchange2:function(event){var tg=event.target,config=this.config,myText="";axdom.each(this.ids,function(idx,D){D.value.dec()==tg.value&&(myText=D.text.dec())}),config.onChange&&config.onChange({target:config.target,value:tg.value,text:myText})}}),AXInputConverter=Class.create(AXJ,{initialize:function(AXJ_super){AXJ_super(),this.objects=[],this.inputTypes=[{type:"search"},{type:"number"},{type:"money"},{type:"slider"},{type:"twinSlider"},{type:"selector"},{type:"switch"},{type:"segment"},{type:"date"},{type:"dateTime"},{type:"twinDate"},{type:"twinDateTime"},{type:"checked"},{type:"pattern"}],this.config.anchorClassName="AXanchor",this.config.anchorPlaceHolderClassName="AXanchorPlaceHolder",this.config.anchorSearchClassName="AXanchorSearch",this.config.anchorNumberContainerClassName="AXanchorNumberContainer",this.config.anchorIncreaseClassName="AXanchorIncrease",this.config.anchorDecreaseClassName="AXanchorDecrease",this.config.anchorSelectorHandleContainerClassName="AXanchorSelectorHandleContainer",this.config.anchorSelectorFinderContainerClassName="AXanchorSelectorFinderContainer",this.config.anchorSelectorHandleClassName="AXanchorSelectorHandle",this.config.anchorSelectorFinderClassName="AXanchorSelectorFinder",this.config.anchorSelectorExpandBoxClassName="AXanchorSelectorExpandBox",this.config.anchorSelectorExpandScrollClassName="AXanchorSelectorExpandScroll",this.config.anchorSliderBoxClassName="AXanchorSliderBox",this.config.anchorSwitchBoxClassName="AXanchorSwitchBox",this.config.anchorSegmentBoxClassName="AXanchorSegmentBox",this.config.anchorDateHandleClassName="AXanchorDateHandle",this.config.bindDateExpandBoxClassName="AXbindDateExpandBox",this.config.bindTwinDateExpandBoxClassName="AXbindTwinDateExpandBox",this.config.anchorCheckedContainerClassName="AXbindCheckedHandle",this.config.responsiveMobile=AXConfig.mobile.responsiveWidth,this.config.reserveKeys={options:AXConfig.AXSelect&&AXConfig.AXSelect.keyOptions||"options",optionValue:AXConfig.AXSelect&&AXConfig.AXSelect.keyOptionValue||"optionValue",optionText:AXConfig.AXSelect&&AXConfig.AXSelect.keyOptionText||"optionText",optionData:AXConfig.AXSelect&&AXConfig.AXSelect.keyOptionData||"optionData",optionDesc:AXConfig.AXSelect&&AXConfig.AXSelect.keyOptionDesc||"optionDesc"}},init:function(){axdom(window).resize(this.alignAllAnchor.bind(this)),this.config.reserveKeys={options:AXConfig.AXInput&&AXConfig.AXInput.keyOptions||"options",optionValue:AXConfig.AXInput&&AXConfig.AXInput.keyOptionValue||"optionValue",optionText:AXConfig.AXInput&&AXConfig.AXInput.keyOptionText||"optionText",optionDesc:AXConfig.AXSelect&&AXConfig.AXSelect.keyOptionDesc||"optionDesc"}},windowResize:function(){var windowResizeApply=this.windowResizeApply.bind(this);this.windowResizeObserver&&clearTimeout(this.windowResizeObserver),this.windowResizeObserver=setTimeout(function(){windowResizeApply()},1)},windowResizeApply:function(){this.windowResizeObserver&&clearTimeout(this.windowResizeObserver),this.alignAllAnchor()},alignAllAnchor:function(){for(var i=0;i