X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/b37ceabb82336ee82757cd32efe353cfab8ec267..f5240829880f87e0cf581c6a296e436fdef0ef80:/examples/ux/ux-all.js?ds=inline diff --git a/examples/ux/ux-all.js b/examples/ux/ux-all.js index f01ca2d1..da4be0af 100644 --- a/examples/ux/ux-all.js +++ b/examples/ux/ux-all.js @@ -1,14 +1,14 @@ /* - * Ext JS Library 3.2.2 + * Ext JS Library 3.3.0 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ -Ext.ns("Ext.ux.grid");Ext.ux.grid.BufferView=Ext.extend(Ext.grid.GridView,{rowHeight:19,borderHeight:2,scrollDelay:100,cacheSize:20,cleanDelay:500,initTemplates:function(){Ext.ux.grid.BufferView.superclass.initTemplates.call(this);var a=this.templates;a.rowHolder=new Ext.Template('
');a.rowHolder.disableFormats=true;a.rowHolder.compile();a.rowBody=new Ext.Template('',"{cells}",(this.enableRowBody?'':""),"
{body}
");a.rowBody.disableFormats=true;a.rowBody.compile()},getStyleRowHeight:function(){return Ext.isBorderBox?(this.rowHeight+this.borderHeight):this.rowHeight},getCalculatedRowHeight:function(){return this.rowHeight+this.borderHeight},getVisibleRowCount:function(){var b=this.getCalculatedRowHeight(),a=this.scroller.dom.clientHeight;return(a<1)?0:Math.ceil(a/b)},getVisibleRows:function(){var a=this.getVisibleRowCount(),b=this.scroller.dom.scrollTop,c=(b===0?0:Math.floor(b/this.getCalculatedRowHeight())-1);return{first:Math.max(c,0),last:Math.min(c+a+2,this.ds.getCount()-1)}},doRender:function(g,k,u,a,s,A,l){var b=this.templates,f=b.cell,h=b.row,x=b.rowBody,n=s-1,t=this.getStyleRowHeight(),z=this.getVisibleRows(),d="width:"+this.getTotalWidth()+";height:"+t+"px;",D=[],w,E,v={},m={tstyle:d},q;for(var y=0,C=k.length;y=z.first&&o<=z.last;if(e){for(var B=0;B0},syncScroll:function(){Ext.ux.grid.BufferView.superclass.syncScroll.apply(this,arguments);this.update()},update:function(){if(this.scrollDelay){if(!this.renderTask){this.renderTask=new Ext.util.DelayedTask(this.doUpdate,this)}this.renderTask.delay(this.scrollDelay)}else{this.doUpdate()}},onRemove:function(d,a,b,c){Ext.ux.grid.BufferView.superclass.onRemove.apply(this,arguments);if(c!==true){this.update()}},doUpdate:function(){if(this.getVisibleRowCount()>0){var f=this.grid,b=f.colModel,h=f.store,e=this.getColumnData(),a=this.getVisibleRows(),j;for(var d=a.first;d<=a.last;d++){if(!this.isRowRendered(d)&&(j=this.getRow(d))){var c=this.doRender(e,[h.getAt(d)],h,d,b.getColumnCount(),f.stripeRows,true);j.innerHTML=c}}this.clean()}},clean:function(){if(!this.cleanTask){this.cleanTask=new Ext.util.DelayedTask(this.doClean,this)}this.cleanTask.delay(this.cleanDelay)},doClean:function(){if(this.getVisibleRowCount()>0){var b=this.getVisibleRows();b.first-=this.cacheSize;b.last+=this.cacheSize;var c=0,d=this.getRows();if(b.first<=0){c=b.last+1}for(var a=this.ds.getCount();cb.last)&&d[c].innerHTML){d[c].innerHTML=""}}}},removeTask:function(b){var a=this[b];if(a&&a.cancel){a.cancel();this[b]=null}},destroy:function(){this.removeTask("cleanTask");this.removeTask("renderTask");Ext.ux.grid.BufferView.superclass.destroy.call(this)},layout:function(){Ext.ux.grid.BufferView.superclass.layout.call(this);this.update()}});Ext.ns("Ext.ux.layout");Ext.ux.layout.CenterLayout=Ext.extend(Ext.layout.FitLayout,{setItemSize:function(b,a){this.container.addClass("ux-layout-center");b.addClass("ux-layout-center-item");if(b&&a.height>0){if(b.width){a.width=b.width}b.setSize(a)}}});Ext.Container.LAYOUTS["ux.center"]=Ext.ux.layout.CenterLayout;Ext.ns("Ext.ux.grid");Ext.ux.grid.CheckColumn=function(a){Ext.apply(this,a);if(!this.id){this.id=Ext.id()}this.renderer=this.renderer.createDelegate(this)};Ext.ux.grid.CheckColumn.prototype={init:function(a){this.grid=a;this.grid.on("render",function(){var b=this.grid.getView();b.mainBody.on("mousedown",this.onMouseDown,this)},this)},onMouseDown:function(d,c){if(Ext.fly(c).hasClass(this.createId())){d.stopEvent();var b=this.grid.getView().findRowIndex(c);var a=this.grid.store.getAt(b);a.set(this.dataIndex,!a.data[this.dataIndex])}},renderer:function(b,c,a){c.css+=" x-grid3-check-col-td";return String.format('
 
',b?"-on":"",this.createId())},createId:function(){return"x-grid3-cc-"+this.id}};Ext.preg("checkcolumn",Ext.ux.grid.CheckColumn);Ext.grid.CheckColumn=Ext.ux.grid.CheckColumn;Ext.ns("Ext.ux.grid");Ext.ux.grid.ColumnHeaderGroup=Ext.extend(Ext.util.Observable,{constructor:function(a){this.config=a},init:function(a){Ext.applyIf(a.colModel,this.config);Ext.apply(a.getView(),this.viewConfig)},viewConfig:{initTemplates:function(){this.constructor.prototype.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell){a.gcell=new Ext.XTemplate('','
',this.grid.enableHdMenu?'':"","{value}
")}this.templates=a;this.hrowRe=new RegExp("ux-grid-hd-group-row-(\\d+)","")},renderHeaders:function(){var h=this.templates,d=[],l=this.cm,p=l.rows,j="width:"+this.getTotalWidth()+";";for(var o=0,k=p.length;o=f&&e=0;c.setChecked(n,true)}q.checked=!q.checked}return true},beforeColMenuShow:function(){var h=this.cm,j=this.cm.rows;this.colMenu.removeAll();for(var d=0,m=h.getColumnCount();d=p&&d=m&&x.oldIndex=m&&x.oldIndex+x.colspan-1=m&&x.newIndex table"),e=this.getTotalWidth(),k=this.cm.rows;for(var j=0;j=c&&b=b&&c=b.col&&p<=b.col+b.colspan){return false}var j=Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupSpan.call(this.view,q-1,k);if(pj.col+j.colspan){return false}return{r:a,px:m,pt:s,row:q,oldIndex:k,newIndex:p,colspan:b.colspan}}});Ext.ns("Ext.ux.tree");Ext.ux.tree.ColumnTree=Ext.extend(Ext.tree.TreePanel,{lines:false,borderWidth:Ext.isBorderBox?0:2,cls:"x-column-tree",onRender:function(){Ext.tree.ColumnTree.superclass.onRender.apply(this,arguments);this.headers=this.header.createChild({cls:"x-tree-headers"});var f=this.columns,g;var b=0;var d=19;for(var e=0,a=f.length;e
','"];for(var e=1,g=l.length;e','
',(j.renderer?j.renderer(m[j.dataIndex],d,m):m[j.dataIndex]),"
","
")}b.push('
','',"");if(o!==true&&d.nextSibling&&d.nextSibling.ui.getEl()){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",d.nextSibling.ui.getEl(),b.join(""))}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",h,b.join(""))}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var f=this.elNode.firstChild.childNodes;this.indentNode=f[0];this.ecNode=f[1];this.iconNode=f[2];this.anchor=f[3];this.textNode=f[3].firstChild}});Ext.tree.ColumnNodeUI=Ext.ux.tree.ColumnNodeUI;Ext.DataView.LabelEditor=Ext.extend(Ext.Editor,{alignment:"tl-tl",hideEl:false,cls:"x-small-editor",shim:false,completeOnEnter:true,cancelOnEsc:true,labelSelector:"span.x-editable",constructor:function(a,b){Ext.DataView.LabelEditor.superclass.constructor.call(this,b||new Ext.form.TextField({allowBlank:false,growMin:90,growMax:240,grow:true,selectOnFocus:true}),a)},init:function(a){this.view=a;a.on("render",this.initEditor,this);this.on("complete",this.onSave,this)},initEditor:function(){this.view.on({scope:this,containerclick:this.doBlur,click:this.doBlur});this.view.getEl().on("mousedown",this.onMouseDown,this,{delegate:this.labelSelector})},doBlur:function(){if(this.editing){this.field.blur()}},onMouseDown:function(d,c){if(!d.ctrlKey&&!d.shiftKey){var b=this.view.findItemFromChild(c);d.stopEvent();var a=this.view.store.getAt(this.view.indexOf(b));this.startEdit(c,a.data[this.dataIndex]);this.activeRecord=a}else{d.preventDefault()}},onSave:function(a,b){this.activeRecord.set(this.dataIndex,b)}});Ext.DataView.DragSelector=function(f){f=f||{};var j,h,l;var d,k,m=new Ext.lib.Region(0,0,0,0);var b=f.dragSafe===true;this.init=function(q){j=q;j.on("render",p)};function n(){d=[];j.all.each(function(q){d[d.length]=q.getRegion()});k=j.el.getRegion()}function e(){return false}function g(q){return !b||q.target==j.el.dom}function o(q){j.on("containerclick",e,j,{single:true});if(!h){h=j.el.createChild({cls:"x-view-selector"})}else{if(h.dom.parentNode!==j.el.dom){j.el.dom.appendChild(h.dom)}h.setDisplayed("block")}n();j.clearSelections()}function c(z){var A=l.startXY;var E=l.getXY();var C=Math.min(A[0],E[0]);var B=Math.min(A[1],E[1]);var D=Math.abs(A[0]-E[0]);var u=Math.abs(A[1]-E[1]);m.left=C;m.top=B;m.right=C+D;m.bottom=B+u;m.constrainTo(k);h.setRegion(m);for(var t=0,v=d.length;t
Level "+accuracy+" Accuracy (8 = Exact Match, 1 = Vague Match)")}else{point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);if(typeof this.setCenter.marker==="object"&&typeof point==="object"){this.addMarker(point,this.setCenter.marker,this.setCenter.marker.clear,true,this.setCenter.listeners)}}}}}});Ext.reg("gmappanel",Ext.ux.GMapPanel);Ext.namespace("Ext.ux.grid");Ext.ux.grid.GridFilters=Ext.extend(Ext.util.Observable,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,constructor:function(a){a=a||{};this.deferredUpdate=new Ext.util.DelayedTask(this.reload,this);this.filters=new Ext.util.MixedCollection();this.filters.getKey=function(b){return b?b.dataIndex:null};this.addFilters(a.filters);delete a.filters;Ext.apply(this,a)},init:function(a){if(a instanceof Ext.grid.GridPanel){this.grid=a;this.bindStore(this.grid.getStore(),true);if(this.filters.getCount()==0){this.addFilters(this.grid.getColumnModel())}this.grid.filters=this;this.grid.addEvents({filterupdate:true});a.on({scope:this,beforestaterestore:this.applyState,beforestatesave:this.saveState,beforedestroy:this.destroy,reconfigure:this.onReconfigure});if(a.rendered){this.onRender()}else{a.on({scope:this,single:true,render:this.onRender})}}else{if(a instanceof Ext.PagingToolbar){this.toolbar=a}}},applyState:function(b,d){var a,c;this.applyingState=true;this.clearFilters();if(d.filters){for(a in d.filters){c=this.filters.get(a);if(c){c.setValue(d.filters[a]);c.setActive(true)}}}this.deferredUpdate.cancel();if(this.local){this.reload()}delete this.applyingState;delete d.filters},saveState:function(a,c){var b={};this.filters.each(function(d){if(d.active){b[d.dataIndex]=d.getValue()}});return(c.filters=b)},onRender:function(){this.grid.getView().on("refresh",this.onRefresh,this);this.createMenu()},destroy:function(){this.removeAll();this.purgeListeners();if(this.filterMenu){Ext.menu.MenuMgr.unregister(this.filterMenu);this.filterMenu.destroy();this.filterMenu=this.menu.menu=null}},removeAll:function(){if(this.filters){Ext.destroy.apply(Ext,this.filters.items);this.filters.clear()}},bindStore:function(a,b){if(!b&&this.store){if(this.local){a.un("load",this.onLoad,this)}else{a.un("beforeload",this.onBeforeLoad,this)}}if(a){if(this.local){a.on("load",this.onLoad,this)}else{a.on("beforeload",this.onBeforeLoad,this)}}this.store=a},onReconfigure:function(){this.bindStore(this.grid.getStore());this.store.clearFilter();this.removeAll();this.addFilters(this.grid.getColumnModel());this.updateColumnHeadings()},createMenu:function(){var a=this.grid.getView(),b=a.hmenu;if(this.showMenu&&b){this.sep=b.addSeparator();this.filterMenu=new Ext.menu.Menu({id:this.grid.id+"-filters-menu"});this.menu=b.add({checked:false,itemId:"filters",text:this.menuFilterText,menu:this.filterMenu});this.menu.on({scope:this,checkchange:this.onCheckChange,beforecheckchange:this.onBeforeCheck});b.on("beforeshow",this.onMenu,this)}this.updateColumnHeadings()},getMenuFilter:function(){var a=this.grid.getView();if(!a||a.hdCtxIndex===undefined){return null}return this.filters.get(a.cm.config[a.hdCtxIndex].dataIndex)},onMenu:function(b){var a=this.getMenuFilter();if(a){this.menu.menu=a.menu;this.menu.setChecked(a.active,false);this.menu.setDisabled(a.disabled===true)}this.menu.setVisible(a!==undefined);this.sep.setVisible(a!==undefined)},onCheckChange:function(a,b){this.getMenuFilter().setActive(b)},onBeforeCheck:function(a,b){return !b||this.getMenuFilter().isActivatable()},onStateChange:function(b,a){if(b==="serialize"){return}if(a==this.getMenuFilter()){this.menu.setChecked(a.active,false)}if((this.autoReload||this.local)&&!this.applyingState){this.deferredUpdate.delay(this.updateBuffer)}this.updateColumnHeadings();if(!this.applyingState){this.grid.saveState()}this.grid.fireEvent("filterupdate",this,a)},onBeforeLoad:function(a,b){b.params=b.params||{};this.cleanParams(b.params);var c=this.buildQuery(this.getFilterData());Ext.apply(b.params,c)},onLoad:function(a,b){a.filterBy(this.getRecordFilter())},onRefresh:function(){this.updateColumnHeadings()},updateColumnHeadings:function(){var b=this.grid.getView(),c,a,d;if(b.mainHd){for(c=0,a=b.cm.config.length;c0){a[this.paramPrefix]=Ext.util.JSON.encode(d)}}return a},cleanParams:function(c){if(this.encode){delete c[this.paramPrefix]}else{var b,a;b=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(a in c){if(b.test(a)){delete c[a]}}}},getFilterClass:function(a){switch(a){case"auto":a="string";break;case"int":case"float":a="numeric";break}return Ext.ux.grid.filter[a.substr(0,1).toUpperCase()+a.substr(1)+"Filter"]}});Ext.preg("gridfilters",Ext.ux.grid.GridFilters);Ext.namespace("Ext.ux.grid.filter");Ext.ux.grid.filter.Filter=Ext.extend(Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(a){Ext.apply(this,a);this.addEvents("activate","deactivate","serialize","update");Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=new Ext.menu.Menu();this.init(a);if(a&&a.value){this.setValue(a.value);this.setActive(a.active!==false,true);delete a.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.purgeListeners()},init:Ext.emptyFn,getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var a=this.getSerialArgs();this.fireEvent("serialize",a,this);return a},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(b,a){if(this.active!=b){this.active=b;if(a!==true){this.fireEvent(b?"activate":"deactivate",this)}}}});Ext.ux.grid.filter.BooleanFilter=Ext.extend(Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(a){var c=Ext.id();this.options=[new Ext.menu.CheckItem({text:this.yesText,group:c,checked:this.defaultValue===true}),new Ext.menu.CheckItem({text:this.noText,group:c,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var b=0;bd){a.after.setChecked(false,true)}}}this.fireEvent("update",this)},getValue:function(){var b,a={};for(b in this.fields){if(this.fields[b].checked){a[b]=this.fields[b].menu.picker.getValue()}}return a},setValue:function(c,b){var a;for(a in this.fields){if(c[a]){this.fields[a].menu.picker.setValue(c[a]);this.fields[a].setChecked(true)}else{if(!b){this.fields[a].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var a;for(a in this.fields){if(this.fields[a].checked){return true}}return false},getSerialArgs:function(){var a=[];for(var b in this.fields){if(this.fields[b].checked){a.push({type:"date",comparison:this.compareMap[b],value:this.getFieldValue(b).format(this.dateFormat)})}}return a},getFieldValue:function(a){return this.fields[a].menu.picker.getValue()},getPicker:function(a){return this.fields[a].menu.picker},validateRecord:function(a){var b,d,c=a.get(this.dataIndex);if(!Ext.isDate(c)){return false}c=c.clearTime(true).getTime();for(b in this.fields){if(this.fields[b].checked){d=this.getFieldValue(b).clearTime(true).getTime();if(b=="before"&&d<=c){return false}if(b=="after"&&d>=c){return false}if(b=="on"&&d!=c){return false}}}return true}});Ext.ux.grid.filter.ListFilter=Ext.extend(Ext.ux.grid.filter.Filter,{phpMode:false,init:function(a){this.dt=new Ext.util.DelayedTask(this.fireUpdate,this);if(this.menu){this.menu.destroy()}this.menu=new Ext.ux.menu.ListMenu(a);this.menu.on("checkchange",this.onCheckChange,this)},getValue:function(){return this.menu.getSelected()},setValue:function(a){this.menu.setSelected(a);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){var a={type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()};return a},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(a){return this.getValue().indexOf(a.get(this.dataIndex))>-1}});Ext.ux.grid.filter.NumericFilter=Ext.extend(Ext.ux.grid.filter.Filter,{fieldCls:Ext.form.NumberField,iconCls:{gt:"ux-rangemenu-gt",lt:"ux-rangemenu-lt",eq:"ux-rangemenu-eq"},menuItemCfgs:{emptyText:"Enter Filter Text...",selectOnFocus:true,width:125},menuItems:["lt","gt","-","eq"],init:function(a){if(this.menu){this.menu.destroy()}this.menu=new Ext.ux.menu.RangeMenu(Ext.apply(a,{fieldCfg:this.fieldCfg||{},fieldCls:this.fieldCls,fields:this.fields||{},iconCls:this.iconCls,menuItemCfgs:this.menuItemCfgs,menuItems:this.menuItems,updateBuffer:this.updateBuffer}));this.menu.on("update",this.fireUpdate,this)},getValue:function(){return this.menu.getValue()},setValue:function(a){this.menu.setValue(a)},isActivatable:function(){var a=this.getValue();for(key in a){if(a[key]!==undefined){return true}}return false},getSerialArgs:function(){var c,b=[],a=this.menu.getValue();for(c in a){b.push({type:"numeric",comparison:c,value:a[c]})}return b},validateRecord:function(a){var c=a.get(this.dataIndex),b=this.getValue();if(b.eq!==undefined&&c!=b.eq){return false}if(b.lt!==undefined&&c>=b.lt){return false}if(b.gt!==undefined&&c<=b.gt){return false}return true}});Ext.ux.grid.filter.StringFilter=Ext.extend(Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(a){Ext.applyIf(a,{enableKeyEvents:true,iconCls:this.iconCls,listeners:{scope:this,keyup:this.onInputKeyUp}});this.inputItem=new Ext.form.TextField(a);this.menu.add(this.inputItem);this.updateTask=new Ext.util.DelayedTask(this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(a){this.inputItem.setValue(a);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(a){var b=a.get(this.dataIndex);if(typeof b!="string"){return(this.getValue().length===0)}return b.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(c,b){var a=b.getKey();if(a==b.RETURN&&c.isValid()){b.stopEvent();this.menu.hide(true);return}this.updateTask.delay(this.updateBuffer)}});Ext.namespace("Ext.ux.menu");Ext.ux.menu.ListMenu=Ext.extend(Ext.menu.Menu,{labelField:"text",loadingText:"Loading...",loadOnShow:true,single:false,constructor:function(b){this.selected=[];this.addEvents("checkchange");Ext.ux.menu.ListMenu.superclass.constructor.call(this,b=b||{});if(!b.store&&b.options){var c=[];for(var d=0,a=b.options.length;d-1,hideOnClick:false});f.itemId=b[d].id;f.on("checkchange",this.checkChange,this);this.add(f)}this.loaded=true;if(g){this.show()}this.fireEvent("load",this,b)},getSelected:function(){return this.selected},setSelected:function(a){a=this.selected=[].concat(a);if(this.loaded){this.items.each(function(d){d.setChecked(false,true);for(var c=0,b=a.length;c0){a[b]=c.getValue()}}return a},setValue:function(b){var a;for(a in this.fields){this.fields[a].setValue(b[a]!==undefined?b[a]:"")}this.fireEvent("update",this)},onInputKeyUp:function(c,b){var a=b.getKey();if(a==b.RETURN&&c.isValid()){b.stopEvent();this.hide(true);return}if(c==this.fields.eq){if(this.fields.gt){this.fields.gt.setValue(null)}if(this.fields.lt){this.fields.lt.setValue(null)}}else{this.fields.eq.setValue(null)}this.updateTask.delay(this.updateBuffer)}}); +Ext.ns("Ext.ux.grid");Ext.ux.grid.BufferView=Ext.extend(Ext.grid.GridView,{rowHeight:19,borderHeight:2,scrollDelay:100,cacheSize:20,cleanDelay:500,initTemplates:function(){Ext.ux.grid.BufferView.superclass.initTemplates.call(this);var a=this.templates;a.rowHolder=new Ext.Template('
');a.rowHolder.disableFormats=true;a.rowHolder.compile();a.rowBody=new Ext.Template('',"{cells}",(this.enableRowBody?'':""),"
{body}
");a.rowBody.disableFormats=true;a.rowBody.compile()},getStyleRowHeight:function(){return Ext.isBorderBox?(this.rowHeight+this.borderHeight):this.rowHeight},getCalculatedRowHeight:function(){return this.rowHeight+this.borderHeight},getVisibleRowCount:function(){var b=this.getCalculatedRowHeight(),a=this.scroller.dom.clientHeight;return(a<1)?0:Math.ceil(a/b)},getVisibleRows:function(){var a=this.getVisibleRowCount(),b=this.scroller.dom.scrollTop,c=(b===0?0:Math.floor(b/this.getCalculatedRowHeight())-1);return{first:Math.max(c,0),last:Math.min(c+a+2,this.ds.getCount()-1)}},doRender:function(g,k,u,a,s,A,l){var b=this.templates,f=b.cell,h=b.row,x=b.rowBody,n=s-1,t=this.getStyleRowHeight(),z=this.getVisibleRows(),d="width:"+this.getTotalWidth()+";height:"+t+"px;",D=[],w,E,v={},m={tstyle:d},q;for(var y=0,C=k.length;y=z.first&&o<=z.last;if(e){for(var B=0;B0},syncScroll:function(){Ext.ux.grid.BufferView.superclass.syncScroll.apply(this,arguments);this.update()},update:function(){if(this.scrollDelay){if(!this.renderTask){this.renderTask=new Ext.util.DelayedTask(this.doUpdate,this)}this.renderTask.delay(this.scrollDelay)}else{this.doUpdate()}},onRemove:function(d,a,b,c){Ext.ux.grid.BufferView.superclass.onRemove.apply(this,arguments);if(c!==true){this.update()}},doUpdate:function(){if(this.getVisibleRowCount()>0){var f=this.grid,b=f.colModel,h=f.store,e=this.getColumnData(),a=this.getVisibleRows(),j;for(var d=a.first;d<=a.last;d++){if(!this.isRowRendered(d)&&(j=this.getRow(d))){var c=this.doRender(e,[h.getAt(d)],h,d,b.getColumnCount(),f.stripeRows,true);j.innerHTML=c}}this.clean()}},clean:function(){if(!this.cleanTask){this.cleanTask=new Ext.util.DelayedTask(this.doClean,this)}this.cleanTask.delay(this.cleanDelay)},doClean:function(){if(this.getVisibleRowCount()>0){var b=this.getVisibleRows();b.first-=this.cacheSize;b.last+=this.cacheSize;var c=0,d=this.getRows();if(b.first<=0){c=b.last+1}for(var a=this.ds.getCount();cb.last)&&d[c].innerHTML){d[c].innerHTML=""}}}},removeTask:function(b){var a=this[b];if(a&&a.cancel){a.cancel();this[b]=null}},destroy:function(){this.removeTask("cleanTask");this.removeTask("renderTask");Ext.ux.grid.BufferView.superclass.destroy.call(this)},layout:function(){Ext.ux.grid.BufferView.superclass.layout.call(this);this.update()}});Ext.ns("Ext.ux.layout");Ext.ux.layout.CenterLayout=Ext.extend(Ext.layout.FitLayout,{setItemSize:function(b,a){this.container.addClass("ux-layout-center");b.addClass("ux-layout-center-item");if(b&&a.height>0){if(b.width){a.width=b.width}b.setSize(a)}}});Ext.Container.LAYOUTS["ux.center"]=Ext.ux.layout.CenterLayout;Ext.ns("Ext.ux.grid");Ext.ux.grid.CheckColumn=Ext.extend(Ext.grid.Column,{processEvent:function(c,f,d,g,b){if(c=="mousedown"){var a=d.store.getAt(g);a.set(this.dataIndex,!a.data[this.dataIndex]);return false}else{return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)}},renderer:function(b,c,a){c.css+=" x-grid3-check-col-td";return String.format('
 
',b?"-on":"")},init:Ext.emptyFn});Ext.preg("checkcolumn",Ext.ux.grid.CheckColumn);Ext.grid.CheckColumn=Ext.ux.grid.CheckColumn;Ext.grid.Column.types.checkcolumn=Ext.ux.grid.CheckColumn;Ext.ns("Ext.ux.grid");Ext.ux.grid.ColumnHeaderGroup=Ext.extend(Ext.util.Observable,{constructor:function(a){this.config=a},init:function(a){Ext.applyIf(a.colModel,this.config);Ext.apply(a.getView(),this.viewConfig)},viewConfig:{initTemplates:function(){this.constructor.prototype.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell){a.gcell=new Ext.XTemplate('','
',this.grid.enableHdMenu?'':"","{value}
")}this.templates=a;this.hrowRe=new RegExp("ux-grid-hd-group-row-(\\d+)","")},renderHeaders:function(){var h=this.templates,d=[],l=this.cm,p=l.rows,j="width:"+this.getTotalWidth()+";";for(var o=0,k=p.length;o=f&&e=0;c.setChecked(n,true)}q.checked=!q.checked}}return true},beforeColMenuShow:function(){var h=this.cm,j=this.cm.rows;this.colMenu.removeAll();for(var d=0,m=h.getColumnCount();d=p&&d=m&&x.oldIndex=m&&x.oldIndex+x.colspan-1=m&&x.newIndex table"),e=this.getTotalWidth(),k=this.cm.rows;for(var j=0;j=c&&b=b&&c=b.col&&p<=b.col+b.colspan){return false}var j=Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupSpan.call(this.view,q-1,k);if(pj.col+j.colspan){return false}return{r:a,px:m,pt:s,row:q,oldIndex:k,newIndex:p,colspan:b.colspan}}});Ext.ns("Ext.ux.tree");Ext.ux.tree.ColumnTree=Ext.extend(Ext.tree.TreePanel,{lines:false,borderWidth:Ext.isBorderBox?0:2,cls:"x-column-tree",onRender:function(){Ext.tree.ColumnTree.superclass.onRender.apply(this,arguments);this.headers=this.header.createChild({cls:"x-tree-headers"});var f=this.columns,g;var b=0;var d=19;for(var e=0,a=f.length;e
','"];for(var e=1,g=l.length;e','
',(j.renderer?j.renderer(m[j.dataIndex],d,m):m[j.dataIndex]),"
","
")}b.push('
','',"");if(o!==true&&d.nextSibling&&d.nextSibling.ui.getEl()){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",d.nextSibling.ui.getEl(),b.join(""))}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",h,b.join(""))}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var f=this.elNode.firstChild.childNodes;this.indentNode=f[0];this.ecNode=f[1];this.iconNode=f[2];this.anchor=f[3];this.textNode=f[3].firstChild}});Ext.tree.ColumnNodeUI=Ext.ux.tree.ColumnNodeUI;Ext.DataView.LabelEditor=Ext.extend(Ext.Editor,{alignment:"tl-tl",hideEl:false,cls:"x-small-editor",shim:false,completeOnEnter:true,cancelOnEsc:true,labelSelector:"span.x-editable",constructor:function(a,b){Ext.DataView.LabelEditor.superclass.constructor.call(this,b||new Ext.form.TextField({allowBlank:false,growMin:90,growMax:240,grow:true,selectOnFocus:true}),a)},init:function(a){this.view=a;a.on("render",this.initEditor,this);this.on("complete",this.onSave,this)},initEditor:function(){this.view.on({scope:this,containerclick:this.doBlur,click:this.doBlur});this.view.getEl().on("mousedown",this.onMouseDown,this,{delegate:this.labelSelector})},doBlur:function(){if(this.editing){this.field.blur()}},onMouseDown:function(d,c){if(!d.ctrlKey&&!d.shiftKey){var b=this.view.findItemFromChild(c);d.stopEvent();var a=this.view.store.getAt(this.view.indexOf(b));this.startEdit(c,a.data[this.dataIndex]);this.activeRecord=a}else{d.preventDefault()}},onSave:function(a,b){this.activeRecord.set(this.dataIndex,b)}});Ext.DataView.DragSelector=function(f){f=f||{};var j,h,l;var d,k,m=new Ext.lib.Region(0,0,0,0);var b=f.dragSafe===true;this.init=function(q){j=q;j.on("render",p)};function n(){d=[];j.all.each(function(q){d[d.length]=q.getRegion()});k=j.el.getRegion()}function e(){return false}function g(q){return !b||q.target==j.el.dom}function o(q){j.on("containerclick",e,j,{single:true});if(!h){h=j.el.createChild({cls:"x-view-selector"})}else{if(h.dom.parentNode!==j.el.dom){j.el.dom.appendChild(h.dom)}h.setDisplayed("block")}n();j.clearSelections()}function c(z){var A=l.startXY;var E=l.getXY();var C=Math.min(A[0],E[0]);var B=Math.min(A[1],E[1]);var D=Math.abs(A[0]-E[0]);var u=Math.abs(A[1]-E[1]);m.left=C;m.top=B;m.right=C+D;m.bottom=B+u;m.constrainTo(k);h.setRegion(m);for(var t=0,v=d.length;t
Level "+accuracy+" Accuracy (8 = Exact Match, 1 = Vague Match)")}else{point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);if(typeof this.setCenter.marker==="object"&&typeof point==="object"){this.addMarker(point,this.setCenter.marker,this.setCenter.marker.clear,true,this.setCenter.listeners)}}}}}});Ext.reg("gmappanel",Ext.ux.GMapPanel);Ext.namespace("Ext.ux.grid");Ext.ux.grid.GridFilters=Ext.extend(Ext.util.Observable,{autoReload:true,filterCls:"ux-filtered-column",local:false,menuFilterText:"Filters",paramPrefix:"filter",showMenu:true,stateId:undefined,updateBuffer:500,constructor:function(a){a=a||{};this.deferredUpdate=new Ext.util.DelayedTask(this.reload,this);this.filters=new Ext.util.MixedCollection();this.filters.getKey=function(b){return b?b.dataIndex:null};this.addFilters(a.filters);delete a.filters;Ext.apply(this,a)},init:function(a){if(a instanceof Ext.grid.GridPanel){this.grid=a;this.bindStore(this.grid.getStore(),true);if(this.filters.getCount()==0){this.addFilters(this.grid.getColumnModel())}this.grid.filters=this;this.grid.addEvents({filterupdate:true});a.on({scope:this,beforestaterestore:this.applyState,beforestatesave:this.saveState,beforedestroy:this.destroy,reconfigure:this.onReconfigure});if(a.rendered){this.onRender()}else{a.on({scope:this,single:true,render:this.onRender})}}else{if(a instanceof Ext.PagingToolbar){this.toolbar=a}}},applyState:function(b,d){var a,c;this.applyingState=true;this.clearFilters();if(d.filters){for(a in d.filters){c=this.filters.get(a);if(c){c.setValue(d.filters[a]);c.setActive(true)}}}this.deferredUpdate.cancel();if(this.local){this.reload()}delete this.applyingState;delete d.filters},saveState:function(a,c){var b={};this.filters.each(function(d){if(d.active){b[d.dataIndex]=d.getValue()}});return(c.filters=b)},onRender:function(){this.grid.getView().on("refresh",this.onRefresh,this);this.createMenu()},destroy:function(){this.removeAll();this.purgeListeners();if(this.filterMenu){Ext.menu.MenuMgr.unregister(this.filterMenu);this.filterMenu.destroy();this.filterMenu=this.menu.menu=null}},removeAll:function(){if(this.filters){Ext.destroy.apply(Ext,this.filters.items);this.filters.clear()}},bindStore:function(a,b){if(!b&&this.store){if(this.local){a.un("load",this.onLoad,this)}else{a.un("beforeload",this.onBeforeLoad,this)}}if(a){if(this.local){a.on("load",this.onLoad,this)}else{a.on("beforeload",this.onBeforeLoad,this)}}this.store=a},onReconfigure:function(){this.bindStore(this.grid.getStore());this.store.clearFilter();this.removeAll();this.addFilters(this.grid.getColumnModel());this.updateColumnHeadings()},createMenu:function(){var a=this.grid.getView(),b=a.hmenu;if(this.showMenu&&b){this.sep=b.addSeparator();this.filterMenu=new Ext.menu.Menu({id:this.grid.id+"-filters-menu"});this.menu=b.add({checked:false,itemId:"filters",text:this.menuFilterText,menu:this.filterMenu});this.menu.on({scope:this,checkchange:this.onCheckChange,beforecheckchange:this.onBeforeCheck});b.on("beforeshow",this.onMenu,this)}this.updateColumnHeadings()},getMenuFilter:function(){var a=this.grid.getView();if(!a||a.hdCtxIndex===undefined){return null}return this.filters.get(a.cm.config[a.hdCtxIndex].dataIndex)},onMenu:function(b){var a=this.getMenuFilter();if(a){this.menu.menu=a.menu;this.menu.setChecked(a.active,false);this.menu.setDisabled(a.disabled===true)}this.menu.setVisible(a!==undefined);this.sep.setVisible(a!==undefined)},onCheckChange:function(a,b){this.getMenuFilter().setActive(b)},onBeforeCheck:function(a,b){return !b||this.getMenuFilter().isActivatable()},onStateChange:function(b,a){if(b==="serialize"){return}if(a==this.getMenuFilter()){this.menu.setChecked(a.active,false)}if((this.autoReload||this.local)&&!this.applyingState){this.deferredUpdate.delay(this.updateBuffer)}this.updateColumnHeadings();if(!this.applyingState){this.grid.saveState()}this.grid.fireEvent("filterupdate",this,a)},onBeforeLoad:function(a,b){b.params=b.params||{};this.cleanParams(b.params);var c=this.buildQuery(this.getFilterData());Ext.apply(b.params,c)},onLoad:function(a,b){a.filterBy(this.getRecordFilter())},onRefresh:function(){this.updateColumnHeadings()},updateColumnHeadings:function(){var b=this.grid.getView(),c,a,d;if(b.mainHd){for(c=0,a=b.cm.config.length;c0){a[this.paramPrefix]=Ext.util.JSON.encode(d)}}return a},cleanParams:function(c){if(this.encode){delete c[this.paramPrefix]}else{var b,a;b=new RegExp("^"+this.paramPrefix+"[[0-9]+]");for(a in c){if(b.test(a)){delete c[a]}}}},getFilterClass:function(a){switch(a){case"auto":a="string";break;case"int":case"float":a="numeric";break;case"bool":a="boolean";break}return Ext.ux.grid.filter[a.substr(0,1).toUpperCase()+a.substr(1)+"Filter"]}});Ext.preg("gridfilters",Ext.ux.grid.GridFilters);Ext.namespace("Ext.ux.grid.filter");Ext.ux.grid.filter.Filter=Ext.extend(Ext.util.Observable,{active:false,dataIndex:null,menu:null,updateBuffer:500,constructor:function(a){Ext.apply(this,a);this.addEvents("activate","deactivate","serialize","update");Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=new Ext.menu.Menu();this.init(a);if(a&&a.value){this.setValue(a.value);this.setActive(a.active!==false,true);delete a.value}},destroy:function(){if(this.menu){this.menu.destroy()}this.purgeListeners()},init:Ext.emptyFn,getValue:Ext.emptyFn,setValue:Ext.emptyFn,isActivatable:function(){return true},getSerialArgs:Ext.emptyFn,validateRecord:function(){return true},serialize:function(){var a=this.getSerialArgs();this.fireEvent("serialize",a,this);return a},fireUpdate:function(){if(this.active){this.fireEvent("update",this)}this.setActive(this.isActivatable())},setActive:function(b,a){if(this.active!=b){this.active=b;if(a!==true){this.fireEvent(b?"activate":"deactivate",this)}}}});Ext.ux.grid.filter.BooleanFilter=Ext.extend(Ext.ux.grid.filter.Filter,{defaultValue:false,yesText:"Yes",noText:"No",init:function(a){var c=Ext.id();this.options=[new Ext.menu.CheckItem({text:this.yesText,group:c,checked:this.defaultValue===true}),new Ext.menu.CheckItem({text:this.noText,group:c,checked:this.defaultValue===false})];this.menu.add(this.options[0],this.options[1]);for(var b=0;bd){a.after.setChecked(false,true)}}}this.fireEvent("update",this)},getValue:function(){var b,a={};for(b in this.fields){if(this.fields[b].checked){a[b]=this.fields[b].menu.picker.getValue()}}return a},setValue:function(c,b){var a;for(a in this.fields){if(c[a]){this.fields[a].menu.picker.setValue(c[a]);this.fields[a].setChecked(true)}else{if(!b){this.fields[a].setChecked(false)}}}this.fireEvent("update",this)},isActivatable:function(){var a;for(a in this.fields){if(this.fields[a].checked){return true}}return false},getSerialArgs:function(){var a=[];for(var b in this.fields){if(this.fields[b].checked){a.push({type:"date",comparison:this.compareMap[b],value:this.getFieldValue(b).format(this.dateFormat)})}}return a},getFieldValue:function(a){return this.fields[a].menu.picker.getValue()},getPicker:function(a){return this.fields[a].menu.picker},validateRecord:function(a){var b,d,c=a.get(this.dataIndex);if(!Ext.isDate(c)){return false}c=c.clearTime(true).getTime();for(b in this.fields){if(this.fields[b].checked){d=this.getFieldValue(b).clearTime(true).getTime();if(b=="before"&&d<=c){return false}if(b=="after"&&d>=c){return false}if(b=="on"&&d!=c){return false}}}return true}});Ext.ux.grid.filter.ListFilter=Ext.extend(Ext.ux.grid.filter.Filter,{phpMode:false,init:function(a){this.dt=new Ext.util.DelayedTask(this.fireUpdate,this);if(this.menu){this.menu.destroy()}this.menu=new Ext.ux.menu.ListMenu(a);this.menu.on("checkchange",this.onCheckChange,this)},getValue:function(){return this.menu.getSelected()},setValue:function(a){this.menu.setSelected(a);this.fireEvent("update",this)},isActivatable:function(){return this.getValue().length>0},getSerialArgs:function(){var a={type:"list",value:this.phpMode?this.getValue().join(","):this.getValue()};return a},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(a){return this.getValue().indexOf(a.get(this.dataIndex))>-1}});Ext.ux.grid.filter.NumericFilter=Ext.extend(Ext.ux.grid.filter.Filter,{fieldCls:Ext.form.NumberField,iconCls:{gt:"ux-rangemenu-gt",lt:"ux-rangemenu-lt",eq:"ux-rangemenu-eq"},menuItemCfgs:{emptyText:"Enter Filter Text...",selectOnFocus:true,width:125},menuItems:["lt","gt","-","eq"],init:function(a){if(this.menu){this.menu.destroy()}this.menu=new Ext.ux.menu.RangeMenu(Ext.apply(a,{fieldCfg:this.fieldCfg||{},fieldCls:this.fieldCls,fields:this.fields||{},iconCls:this.iconCls,menuItemCfgs:this.menuItemCfgs,menuItems:this.menuItems,updateBuffer:this.updateBuffer}));this.menu.on("update",this.fireUpdate,this)},getValue:function(){return this.menu.getValue()},setValue:function(a){this.menu.setValue(a)},isActivatable:function(){var a=this.getValue();for(key in a){if(a[key]!==undefined){return true}}return false},getSerialArgs:function(){var c,b=[],a=this.menu.getValue();for(c in a){b.push({type:"numeric",comparison:c,value:a[c]})}return b},validateRecord:function(a){var c=a.get(this.dataIndex),b=this.getValue();if(b.eq!==undefined&&c!=b.eq){return false}if(b.lt!==undefined&&c>=b.lt){return false}if(b.gt!==undefined&&c<=b.gt){return false}return true}});Ext.ux.grid.filter.StringFilter=Ext.extend(Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:true,width:125,init:function(a){Ext.applyIf(a,{enableKeyEvents:true,iconCls:this.iconCls,listeners:{scope:this,keyup:this.onInputKeyUp}});this.inputItem=new Ext.form.TextField(a);this.menu.add(this.inputItem);this.updateTask=new Ext.util.DelayedTask(this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(a){this.inputItem.setValue(a);this.fireEvent("update",this)},isActivatable:function(){return this.inputItem.getValue().length>0},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(a){var b=a.get(this.dataIndex);if(typeof b!="string"){return(this.getValue().length===0)}return b.toLowerCase().indexOf(this.getValue().toLowerCase())>-1},onInputKeyUp:function(c,b){var a=b.getKey();if(a==b.RETURN&&c.isValid()){b.stopEvent();this.menu.hide(true);return}this.updateTask.delay(this.updateBuffer)}});Ext.namespace("Ext.ux.menu");Ext.ux.menu.ListMenu=Ext.extend(Ext.menu.Menu,{labelField:"text",loadingText:"Loading...",loadOnShow:true,single:false,constructor:function(b){this.selected=[];this.addEvents("checkchange");Ext.ux.menu.ListMenu.superclass.constructor.call(this,b=b||{});if(!b.store&&b.options){var c=[];for(var d=0,a=b.options.length;d-1,hideOnClick:false});f.itemId=b[d].id;f.on("checkchange",this.checkChange,this);this.add(f)}this.loaded=true;if(g){this.show()}this.fireEvent("load",this,b)},getSelected:function(){return this.selected},setSelected:function(a){a=this.selected=[].concat(a);if(this.loaded){this.items.each(function(d){d.setChecked(false,true);for(var c=0,b=a.length;c0){a[b]=c.getValue()}}return a},setValue:function(b){var a;for(a in this.fields){this.fields[a].setValue(b[a]!==undefined?b[a]:"")}this.fireEvent("update",this)},onInputKeyUp:function(c,b){var a=b.getKey();if(a==b.RETURN&&c.isValid()){b.stopEvent();this.hide(true);return}if(c==this.fields.eq){if(this.fields.gt){this.fields.gt.setValue(null)}if(this.fields.lt){this.fields.lt.setValue(null)}}else{this.fields.eq.setValue(null)}this.updateTask.delay(this.updateBuffer)}});Ext.ns("Ext.ux.grid");Ext.ux.grid.GroupSummary=Ext.extend(Ext.util.Observable,{constructor:function(a){Ext.apply(this,a);Ext.ux.grid.GroupSummary.superclass.constructor.call(this)},init:function(b){this.grid=b;var a=this.view=b.getView();a.doGroupEnd=this.doGroupEnd.createDelegate(this);a.afterMethod("onColumnWidthUpdated",this.doWidth,this);a.afterMethod("onAllColumnWidthsUpdated",this.doAllWidths,this);a.afterMethod("onColumnHiddenUpdated",this.doHidden,this);a.afterMethod("onUpdate",this.doUpdate,this);a.afterMethod("onRemove",this.doRemove,this);if(!this.rowTpl){this.rowTpl=new Ext.Template('
','',"{cells}","
");this.rowTpl.disableFormats=true}this.rowTpl.compile();if(!this.cellTpl){this.cellTpl=new Ext.Template('','
{value}
',"");this.cellTpl.disableFormats=true}this.cellTpl.compile()},toggleSummaries:function(b){var a=this.grid.getGridEl();if(a){if(b===undefined){b=a.hasClass("x-grid-hide-summary")}a[b?"removeClass":"addClass"]("x-grid-hide-summary")}},renderSummary:function(d,h){h=h||this.view.getColumnData();var j=this.grid.getColumnModel().config,e=[],k,a={},b,l=h.length-1;for(var f=0,g=h.length;f",this.renderSummary({data:e},b),"")},doWidth:function(e,b,d){if(!this.isGrouped()){return}var c=this.view.getGroups(),a=c.length,f=0,g;for(;f'+d+""}}});Ext.grid.GroupSummary=Ext.ux.grid.GroupSummary;Ext.ux.grid.GroupSummary.Calculations={sum:function(b,a,c){return b+(a.data[c]||0)},count:function(b,a,d,c){return c[d+"count"]?++c[d+"count"]:(c[d+"count"]=1)},max:function(c,b,e,d){var c=b.data[e];var a=d[e+"max"]===undefined?(d[e+"max"]=c):d[e+"max"];return c>a?(d[e+"max"]=c):a},min:function(b,a,e,d){var b=a.data[e];var c=d[e+"min"]===undefined?(d[e+"min"]=b):d[e+"min"];return b','{text}',"");c.disableFormats=true;c.compile();Ext.ux.GroupTab.prototype.itemTpl=c}this.items.each(this.initTab,this)},afterRender:function(){Ext.ux.GroupTab.superclass.afterRender.call(this);if(this.activeTab!==undefined){var a=(typeof this.activeTab=="object")?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initTab:function(c,a){var d=this.strip.dom.childNodes[a];var e=Ext.TabPanel.prototype.getTemplateArgs.call(this,c);if(c===this.mainItem){c.tabEl=this.groupEl;e.cls+=" x-grouptabs-main-item"}var b=d?this.itemTpl.insertBefore(d,e):this.itemTpl.append(this.strip,e);c.tabEl=c.tabEl||b;c.on("disable",this.onItemDisabled,this);c.on("enable",this.onItemEnabled,this);c.on("titlechange",this.onItemTitleChanged,this);c.on("iconchange",this.onItemIconChanged,this);c.on("beforeshow",this.onBeforeShowItem,this)},setMainItem:function(a){a=this.getComponent(a);if(!a||this.fireEvent("changemainitem",this,a,this.mainItem)===false){return}this.mainItem=a},getMainItem:function(){return this.mainItem||null},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onAdd:function(a,c,b){if(this.rendered){this.initTab.call(this,c,b)}},onRemove:function(c,b){Ext.destroy(Ext.get(this.getTabEl(b)));this.stack.remove(b);b.un("disable",this.onItemDisabled,this);b.un("enable",this.onItemEnabled,this);b.un("titlechange",this.onItemTitleChanged,this);b.un("iconchange",this.onItemIconChanged,this);b.un("beforeshow",this.onBeforeShowItem,this);if(b==this.activeTab){var a=this.stack.next();if(a){this.setActiveTab(a)}else{if(this.items.getCount()>0){this.setActiveTab(0)}else{this.activeTab=null}}}},onBeforeAdd:function(b){var a=b.events?(this.items.containsKey(b.getItemId())?b:null):this.items.get(b);if(a){this.setActiveTab(b);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var c=b.elements;b.elements=c?c.replace(",header",""):c;b.border=(b.border===true)},onItemDisabled:Ext.TabPanel.prototype.onItemDisabled,onItemEnabled:Ext.TabPanel.prototype.onItemEnabled,onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("a.x-grouptabs-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){Ext.fly(b).child("a.x-grouptabs-text").replaceClass(c,a)}},beforeDestroy:function(){Ext.TabPanel.prototype.beforeDestroy.call(this);this.tooltip.destroy()}});Ext.reg("grouptab",Ext.ux.GroupTab);Ext.ns("Ext.ux");Ext.ux.GroupTabPanel=Ext.extend(Ext.TabPanel,{tabPosition:"left",alternateColor:false,alternateCls:"x-grouptabs-panel-alt",defaultType:"grouptab",deferredRender:false,activeGroup:null,initComponent:function(){Ext.ux.GroupTabPanel.superclass.initComponent.call(this);this.addEvents("beforegroupchange","groupchange");this.elements="body,header";this.stripTarget="header";this.tabPosition=this.tabPosition=="right"?"right":"left";this.addClass("x-grouptabs-panel");if(this.tabStyle&&this.tabStyle!=""){this.addClass("x-grouptabs-panel-"+this.tabStyle)}if(this.alternateColor){this.addClass(this.alternateCls)}this.on("beforeadd",function(b,c,a){this.initGroup(c,a)});this.items.each(function(a){a.on("tabchange",function(b){this.fireEvent("tabchange",this,b.activeTab)},this)},this)},initEvents:function(){this.mon(this.strip,"mousedown",this.onStripMouseDown,this)},onRender:function(c,a){Ext.TabPanel.superclass.onRender.call(this,c,a);if(this.plain){var f=this.tabPosition=="top"?"header":"footer";this[f].addClass("x-tab-panel-"+f+"-plain")}var b=this[this.stripTarget];this.stripWrap=b.createChild({cls:"x-tab-strip-wrap ",cn:{tag:"ul",cls:"x-grouptabs-strip x-grouptabs-tab-strip-"+this.tabPosition}});var e=(this.tabPosition=="bottom"?this.stripWrap:null);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.header.addClass("x-grouptabs-panel-header");this.bwrap.addClass("x-grouptabs-bwrap");this.body.addClass("x-tab-panel-body-"+this.tabPosition+" x-grouptabs-panel-body");if(!this.groupTpl){var d=new Ext.Template('
  • ','','',"{text}","
  • ");d.disableFormats=true;d.compile();Ext.ux.GroupTabPanel.prototype.groupTpl=d}this.items.each(this.initGroup,this)},afterRender:function(){Ext.ux.GroupTabPanel.superclass.afterRender.call(this);this.tabJoint=Ext.fly(this.body.dom.parentNode).createChild({cls:"x-tab-joint"});this.addClass("x-tab-panel-"+this.tabPosition);this.header.setWidth(this.tabWidth);if(this.activeGroup!==undefined){var a=(typeof this.activeGroup=="object")?this.activeGroup:this.items.get(this.activeGroup);delete this.activeGroup;this.setActiveGroup(a);a.setActiveTab(a.getMainItem())}},getGroupEl:Ext.TabPanel.prototype.getTabEl,findTargets:function(c){var b=null,a=c.getTarget("li",this.strip);if(a){b=this.findById(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{expand:null,item:null,el:null}}}return{expand:c.getTarget(".x-grouptabs-expand",this.strip),isGroup:!c.getTarget("ul.x-grouptabs-sub",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!=0){return}b.preventDefault();var a=this.findTargets(b);if(a.expand){this.toggleGroup(a.el)}else{if(a.item){if(a.isGroup){a.item.setActiveTab(a.item.getMainItem())}else{a.item.ownerCt.setActiveTab(a.item)}}}},expandGroup:function(a){if(a.isXType){a=this.getGroupEl(a)}Ext.fly(a).addClass("x-grouptabs-expanded");this.syncTabJoint()},toggleGroup:function(a){if(a.isXType){a=this.getGroupEl(a)}Ext.fly(a).toggleClass("x-grouptabs-expanded");this.syncTabJoint()},collapseGroup:function(a){if(a.isXType){a=this.getGroupEl(a)}Ext.fly(a).removeClass("x-grouptabs-expanded");this.syncTabJoint()},syncTabJoint:function(b){if(!this.tabJoint){return}b=b||this.getGroupEl(this.activeGroup);if(b){this.tabJoint.setHeight(Ext.fly(b).getHeight()-2);var a=Ext.isGecko2?0:1;if(this.tabPosition=="left"){this.tabJoint.alignTo(b,"tl-tr",[-2,a])}else{this.tabJoint.alignTo(b,"tr-tl",[1,a])}}else{this.tabJoint.hide()}},getActiveTab:function(){if(!this.activeGroup){return null}return this.activeGroup.getTabEl(this.activeGroup.activeTab)||null},onResize:function(){Ext.ux.GroupTabPanel.superclass.onResize.apply(this,arguments);this.syncTabJoint()},createCorner:function(a,b){return Ext.fly(a).createChild({cls:"x-grouptabs-corner x-grouptabs-corner-"+b})},initGroup:function(f,b){var d=this.strip.dom.childNodes[b],e=this.getTemplateArgs(f);if(b===0){e.cls+=" x-tab-first"}e.cls+=" x-grouptabs-main";e.text=f.getMainItem().title;var c=d?this.groupTpl.insertBefore(d,e):this.groupTpl.append(this.strip,e),a=this.createCorner(c,"top-"+this.tabPosition),g=this.createCorner(c,"bottom-"+this.tabPosition);f.tabEl=c;if(f.expanded){this.expandGroup(c)}if(Ext.isIE6||(Ext.isIE&&!Ext.isStrict)){g.setLeft("-10px");g.setBottom("-5px");a.setLeft("-10px");a.setTop("-5px")}this.mon(f,{scope:this,changemainitem:this.onGroupChangeMainItem,beforetabchange:this.onGroupBeforeTabChange})},setActiveGroup:function(b){b=this.getComponent(b);if(!b){return false}if(!this.rendered){this.activeGroup=b;return true}if(this.activeGroup!=b&&this.fireEvent("beforegroupchange",this,b,this.activeGroup)!==false){if(this.activeGroup){this.activeGroup.activeTab=null;var a=this.getGroupEl(this.activeGroup);if(a){Ext.fly(a).removeClass("x-grouptabs-strip-active")}}var c=this.getGroupEl(b);Ext.fly(c).addClass("x-grouptabs-strip-active");this.activeGroup=b;this.stack.add(b);this.layout.setActiveItem(b);this.syncTabJoint(c);this.fireEvent("groupchange",this,b);return true}return false},onGroupBeforeTabChange:function(a,c,b){if(a!==this.activeGroup||c!==b){this.strip.select(".x-grouptabs-sub > li.x-grouptabs-strip-active",true).removeClass("x-grouptabs-strip-active")}this.expandGroup(this.getGroupEl(a));if(a!==this.activeGroup){return this.setActiveGroup(a)}},getFrameHeight:function(){var a=this.el.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);return a},adjustBodyWidth:function(a){return a-this.tabWidth}});Ext.reg("grouptabpanel",Ext.ux.GroupTabPanel);Ext.ux.form.ItemSelector=Ext.extend(Ext.form.Field,{hideNavIcons:false,imagePath:"",iconUp:"up2.gif",iconDown:"down2.gif",iconLeft:"left2.gif",iconRight:"right2.gif",iconTop:"top2.gif",iconBottom:"bottom2.gif",drawUpIcon:true,drawDownIcon:true,drawLeftIcon:true,drawRightIcon:true,drawTopIcon:true,drawBotIcon:true,delimiter:",",bodyStyle:null,border:false,defaultAutoCreate:{tag:"div"},multiselects:null,initComponent:function(){Ext.ux.form.ItemSelector.superclass.initComponent.call(this);this.addEvents({rowdblclick:true,change:true})},onRender:function(d,a){Ext.ux.form.ItemSelector.superclass.onRender.call(this,d,a);var h=[{legend:"Available",draggable:true,droppable:true,width:100,height:100},{legend:"Selected",droppable:true,draggable:true,width:100,height:100}];this.fromMultiselect=new Ext.ux.form.MultiSelect(Ext.applyIf(this.multiselects[0],h[0]));this.fromMultiselect.on("dblclick",this.onRowDblClick,this);this.toMultiselect=new Ext.ux.form.MultiSelect(Ext.applyIf(this.multiselects[1],h[1]));this.toMultiselect.on("dblclick",this.onRowDblClick,this);var g=new Ext.Panel({bodyStyle:this.bodyStyle,border:this.border,layout:"table",layoutConfig:{columns:3}});g.add(this.fromMultiselect);var c=new Ext.Panel({header:false});g.add(c);g.add(this.toMultiselect);g.render(this.el);c.el.down("."+c.bwrapCls).remove();if(this.imagePath!=""&&this.imagePath.charAt(this.imagePath.length-1)!="/"){this.imagePath+="/"}this.iconUp=this.imagePath+(this.iconUp||"up2.gif");this.iconDown=this.imagePath+(this.iconDown||"down2.gif");this.iconLeft=this.imagePath+(this.iconLeft||"left2.gif");this.iconRight=this.imagePath+(this.iconRight||"right2.gif");this.iconTop=this.imagePath+(this.iconTop||"top2.gif");this.iconBottom=this.imagePath+(this.iconBottom||"bottom2.gif");var f=c.getEl();this.toTopIcon=f.createChild({tag:"img",src:this.iconTop,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.upIcon=f.createChild({tag:"img",src:this.iconUp,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.addIcon=f.createChild({tag:"img",src:this.iconRight,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.removeIcon=f.createChild({tag:"img",src:this.iconLeft,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.downIcon=f.createChild({tag:"img",src:this.iconDown,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.toBottomIcon=f.createChild({tag:"img",src:this.iconBottom,style:{cursor:"pointer",margin:"2px"}});this.toTopIcon.on("click",this.toTop,this);this.upIcon.on("click",this.up,this);this.downIcon.on("click",this.down,this);this.toBottomIcon.on("click",this.toBottom,this);this.addIcon.on("click",this.fromTo,this);this.removeIcon.on("click",this.toFrom,this);if(!this.drawUpIcon||this.hideNavIcons){this.upIcon.dom.style.display="none"}if(!this.drawDownIcon||this.hideNavIcons){this.downIcon.dom.style.display="none"}if(!this.drawLeftIcon||this.hideNavIcons){this.addIcon.dom.style.display="none"}if(!this.drawRightIcon||this.hideNavIcons){this.removeIcon.dom.style.display="none"}if(!this.drawTopIcon||this.hideNavIcons){this.toTopIcon.dom.style.display="none"}if(!this.drawBotIcon||this.hideNavIcons){this.toBottomIcon.dom.style.display="none"}var b=g.body.first();this.el.setWidth(g.body.first().getWidth());g.body.removeClass();this.hiddenName=this.name;var e={tag:"input",type:"hidden",value:"",name:this.name};this.hiddenField=this.el.createChild(e)},doLayout:function(){if(this.rendered){this.fromMultiselect.fs.doLayout();this.toMultiselect.fs.doLayout()}},afterRender:function(){Ext.ux.form.ItemSelector.superclass.afterRender.call(this);this.toStore=this.toMultiselect.store;this.toStore.on("add",this.valueChanged,this);this.toStore.on("remove",this.valueChanged,this);this.toStore.on("load",this.valueChanged,this);this.valueChanged(this.toStore)},toTop:function(){var c=this.toMultiselect.view.getSelectedIndexes();var a=[];if(c.length>0){c.sort();for(var b=0;b-1;b--){record=a[b];this.toMultiselect.view.store.remove(record);this.toMultiselect.view.store.insert(0,record);c.push(((a.length-1)-b))}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(c)},toBottom:function(){var c=this.toMultiselect.view.getSelectedIndexes();var a=[];if(c.length>0){c.sort();for(var b=0;b0){for(var b=0;b=0){this.toMultiselect.view.store.remove(a);this.toMultiselect.view.store.insert(c[b]-1,a);d.push(c[b]-1)}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(d)}},down:function(){var a=null;var c=this.toMultiselect.view.getSelectedIndexes();c.sort();c.reverse();var d=[];if(c.length>0){for(var b=0;b0){for(var d=0;d0){for(var c=0;c','',"{cells}","
    ");this.rowTpl.disableFormats=true}this.rowTpl.compile();if(!this.cellTpl){this.cellTpl=new Ext.Template('','
    {value}
    ',"");this.cellTpl.disableFormats=true}this.cellTpl.compile()},toggleSummaries:function(b){var a=this.grid.getGridEl();if(a){if(b===undefined){b=a.hasClass("x-grid-hide-summary")}a[b?"removeClass":"addClass"]("x-grid-hide-summary")}},renderSummary:function(d,h){h=h||this.view.getColumnData();var j=this.grid.getColumnModel().config,e=[],k,a={},b,l=h.length-1;for(var f=0,g=h.length;f",this.renderSummary({data:e},b),"")},doWidth:function(e,b,d){if(!this.isGrouped()){return}var c=this.view.getGroups(),a=c.length,f=0,g;for(;f'+d+""}}});Ext.grid.GroupSummary=Ext.ux.grid.GroupSummary;Ext.ux.grid.GroupSummary.Calculations={sum:function(b,a,c){return b+(a.data[c]||0)},count:function(b,a,d,c){return c[d+"count"]?++c[d+"count"]:(c[d+"count"]=1)},max:function(c,b,e,d){var c=b.data[e];var a=d[e+"max"]===undefined?(d[e+"max"]=c):d[e+"max"];return c>a?(d[e+"max"]=c):a},min:function(b,a,e,d){var b=a.data[e];var c=d[e+"min"]===undefined?(d[e+"min"]=b):d[e+"min"];return b','{text}',"");c.disableFormats=true;c.compile();Ext.ux.GroupTab.prototype.itemTpl=c}this.items.each(this.initTab,this)},afterRender:function(){Ext.ux.GroupTab.superclass.afterRender.call(this);if(this.activeTab!==undefined){var a=(typeof this.activeTab=="object")?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},initTab:function(c,a){var d=this.strip.dom.childNodes[a];var e=Ext.TabPanel.prototype.getTemplateArgs.call(this,c);if(c===this.mainItem){c.tabEl=this.groupEl;e.cls+=" x-grouptabs-main-item"}var b=d?this.itemTpl.insertBefore(d,e):this.itemTpl.append(this.strip,e);c.tabEl=c.tabEl||b;c.on("disable",this.onItemDisabled,this);c.on("enable",this.onItemEnabled,this);c.on("titlechange",this.onItemTitleChanged,this);c.on("iconchange",this.onItemIconChanged,this);c.on("beforeshow",this.onBeforeShowItem,this)},setMainItem:function(a){a=this.getComponent(a);if(!a||this.fireEvent("changemainitem",this,a,this.mainItem)===false){return}this.mainItem=a},getMainItem:function(){return this.mainItem||null},onBeforeShowItem:function(a){if(a!=this.activeTab){this.setActiveTab(a);return false}},onAdd:function(a,c,b){if(this.rendered){this.initTab.call(this,c,b)}},onRemove:function(c,b){Ext.destroy(Ext.get(this.getTabEl(b)));this.stack.remove(b);b.un("disable",this.onItemDisabled,this);b.un("enable",this.onItemEnabled,this);b.un("titlechange",this.onItemTitleChanged,this);b.un("iconchange",this.onItemIconChanged,this);b.un("beforeshow",this.onBeforeShowItem,this);if(b==this.activeTab){var a=this.stack.next();if(a){this.setActiveTab(a)}else{if(this.items.getCount()>0){this.setActiveTab(0)}else{this.activeTab=null}}}},onBeforeAdd:function(b){var a=b.events?(this.items.containsKey(b.getItemId())?b:null):this.items.get(b);if(a){this.setActiveTab(b);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var c=b.elements;b.elements=c?c.replace(",header",""):c;b.border=(b.border===true)},onItemDisabled:Ext.TabPanel.prototype.onItemDisabled,onItemEnabled:Ext.TabPanel.prototype.onItemEnabled,onItemTitleChanged:function(b){var a=this.getTabEl(b);if(a){Ext.fly(a).child("a.x-grouptabs-text",true).innerHTML=b.title}},onItemIconChanged:function(d,a,c){var b=this.getTabEl(d);if(b){Ext.fly(b).child("a.x-grouptabs-text").replaceClass(c,a)}},beforeDestroy:function(){Ext.TabPanel.prototype.beforeDestroy.call(this);this.tooltip.destroy()}});Ext.reg("grouptab",Ext.ux.GroupTab);Ext.ns("Ext.ux");Ext.ux.GroupTabPanel=Ext.extend(Ext.TabPanel,{tabPosition:"left",alternateColor:false,alternateCls:"x-grouptabs-panel-alt",defaultType:"grouptab",deferredRender:false,activeGroup:null,initComponent:function(){Ext.ux.GroupTabPanel.superclass.initComponent.call(this);this.addEvents("beforegroupchange","groupchange");this.elements="body,header";this.stripTarget="header";this.tabPosition=this.tabPosition=="right"?"right":"left";this.addClass("x-grouptabs-panel");if(this.tabStyle&&this.tabStyle!=""){this.addClass("x-grouptabs-panel-"+this.tabStyle)}if(this.alternateColor){this.addClass(this.alternateCls)}this.on("beforeadd",function(b,c,a){this.initGroup(c,a)});this.items.each(function(a){a.on("tabchange",function(b){this.fireEvent("tabchange",this,b.activeTab)},this)},this)},initEvents:function(){this.mon(this.strip,"mousedown",this.onStripMouseDown,this)},onRender:function(c,a){Ext.TabPanel.superclass.onRender.call(this,c,a);if(this.plain){var f=this.tabPosition=="top"?"header":"footer";this[f].addClass("x-tab-panel-"+f+"-plain")}var b=this[this.stripTarget];this.stripWrap=b.createChild({cls:"x-tab-strip-wrap ",cn:{tag:"ul",cls:"x-grouptabs-strip x-grouptabs-tab-strip-"+this.tabPosition}});var e=(this.tabPosition=="bottom"?this.stripWrap:null);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.header.addClass("x-grouptabs-panel-header");this.bwrap.addClass("x-grouptabs-bwrap");this.body.addClass("x-tab-panel-body-"+this.tabPosition+" x-grouptabs-panel-body");if(!this.groupTpl){var d=new Ext.Template('
  • ','','',"{text}","
  • ");d.disableFormats=true;d.compile();Ext.ux.GroupTabPanel.prototype.groupTpl=d}this.items.each(this.initGroup,this)},afterRender:function(){Ext.ux.GroupTabPanel.superclass.afterRender.call(this);this.tabJoint=Ext.fly(this.body.dom.parentNode).createChild({cls:"x-tab-joint"});this.addClass("x-tab-panel-"+this.tabPosition);this.header.setWidth(this.tabWidth);if(this.activeGroup!==undefined){var a=(typeof this.activeGroup=="object")?this.activeGroup:this.items.get(this.activeGroup);delete this.activeGroup;this.setActiveGroup(a);a.setActiveTab(a.getMainItem())}},getGroupEl:Ext.TabPanel.prototype.getTabEl,findTargets:function(c){var b=null,a=c.getTarget("li",this.strip);if(a){b=this.findById(a.id.split(this.idDelimiter)[1]);if(b.disabled){return{expand:null,item:null,el:null}}}return{expand:c.getTarget(".x-grouptabs-expand",this.strip),isGroup:!c.getTarget("ul.x-grouptabs-sub",this.strip),item:b,el:a}},onStripMouseDown:function(b){if(b.button!=0){return}b.preventDefault();var a=this.findTargets(b);if(a.expand){this.toggleGroup(a.el)}else{if(a.item){if(a.isGroup){a.item.setActiveTab(a.item.getMainItem())}else{a.item.ownerCt.setActiveTab(a.item)}}}},expandGroup:function(a){if(a.isXType){a=this.getGroupEl(a)}Ext.fly(a).addClass("x-grouptabs-expanded");this.syncTabJoint()},toggleGroup:function(a){if(a.isXType){a=this.getGroupEl(a)}Ext.fly(a).toggleClass("x-grouptabs-expanded");this.syncTabJoint()},collapseGroup:function(a){if(a.isXType){a=this.getGroupEl(a)}Ext.fly(a).removeClass("x-grouptabs-expanded");this.syncTabJoint()},syncTabJoint:function(b){if(!this.tabJoint){return}b=b||this.getGroupEl(this.activeGroup);if(b){this.tabJoint.setHeight(Ext.fly(b).getHeight()-2);var a=Ext.isGecko2?0:1;if(this.tabPosition=="left"){this.tabJoint.alignTo(b,"tl-tr",[-2,a])}else{this.tabJoint.alignTo(b,"tr-tl",[1,a])}}else{this.tabJoint.hide()}},getActiveTab:function(){if(!this.activeGroup){return null}return this.activeGroup.getTabEl(this.activeGroup.activeTab)||null},onResize:function(){Ext.ux.GroupTabPanel.superclass.onResize.apply(this,arguments);this.syncTabJoint()},createCorner:function(a,b){return Ext.fly(a).createChild({cls:"x-grouptabs-corner x-grouptabs-corner-"+b})},initGroup:function(f,b){var d=this.strip.dom.childNodes[b],e=this.getTemplateArgs(f);if(b===0){e.cls+=" x-tab-first"}e.cls+=" x-grouptabs-main";e.text=f.getMainItem().title;var c=d?this.groupTpl.insertBefore(d,e):this.groupTpl.append(this.strip,e),a=this.createCorner(c,"top-"+this.tabPosition),g=this.createCorner(c,"bottom-"+this.tabPosition);f.tabEl=c;if(f.expanded){this.expandGroup(c)}if(Ext.isIE6||(Ext.isIE&&!Ext.isStrict)){g.setLeft("-10px");g.setBottom("-5px");a.setLeft("-10px");a.setTop("-5px")}this.mon(f,{scope:this,changemainitem:this.onGroupChangeMainItem,beforetabchange:this.onGroupBeforeTabChange})},setActiveGroup:function(b){b=this.getComponent(b);if(!b){return false}if(!this.rendered){this.activeGroup=b;return true}if(this.activeGroup!=b&&this.fireEvent("beforegroupchange",this,b,this.activeGroup)!==false){if(this.activeGroup){this.activeGroup.activeTab=null;var a=this.getGroupEl(this.activeGroup);if(a){Ext.fly(a).removeClass("x-grouptabs-strip-active")}}var c=this.getGroupEl(b);Ext.fly(c).addClass("x-grouptabs-strip-active");this.activeGroup=b;this.stack.add(b);this.layout.setActiveItem(b);this.syncTabJoint(c);this.fireEvent("groupchange",this,b);return true}return false},onGroupBeforeTabChange:function(a,c,b){if(a!==this.activeGroup||c!==b){this.strip.select(".x-grouptabs-sub > li.x-grouptabs-strip-active",true).removeClass("x-grouptabs-strip-active")}this.expandGroup(this.getGroupEl(a));if(a!==this.activeGroup){return this.setActiveGroup(a)}},getFrameHeight:function(){var a=this.el.getFrameWidth("tb");a+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);return a},adjustBodyWidth:function(a){return a-this.tabWidth}});Ext.reg("grouptabpanel",Ext.ux.GroupTabPanel);Ext.ux.form.ItemSelector=Ext.extend(Ext.form.Field,{hideNavIcons:false,imagePath:"",iconUp:"up2.gif",iconDown:"down2.gif",iconLeft:"left2.gif",iconRight:"right2.gif",iconTop:"top2.gif",iconBottom:"bottom2.gif",drawUpIcon:true,drawDownIcon:true,drawLeftIcon:true,drawRightIcon:true,drawTopIcon:true,drawBotIcon:true,delimiter:",",bodyStyle:null,border:false,defaultAutoCreate:{tag:"div"},multiselects:null,initComponent:function(){Ext.ux.form.ItemSelector.superclass.initComponent.call(this);this.addEvents({rowdblclick:true,change:true})},onRender:function(d,a){Ext.ux.form.ItemSelector.superclass.onRender.call(this,d,a);var h=[{legend:"Available",draggable:true,droppable:true,width:100,height:100},{legend:"Selected",droppable:true,draggable:true,width:100,height:100}];this.fromMultiselect=new Ext.ux.form.MultiSelect(Ext.applyIf(this.multiselects[0],h[0]));this.fromMultiselect.on("dblclick",this.onRowDblClick,this);this.toMultiselect=new Ext.ux.form.MultiSelect(Ext.applyIf(this.multiselects[1],h[1]));this.toMultiselect.on("dblclick",this.onRowDblClick,this);var g=new Ext.Panel({bodyStyle:this.bodyStyle,border:this.border,layout:"table",layoutConfig:{columns:3}});g.add(this.fromMultiselect);var c=new Ext.Panel({header:false});g.add(c);g.add(this.toMultiselect);g.render(this.el);c.el.down("."+c.bwrapCls).remove();if(this.imagePath!=""&&this.imagePath.charAt(this.imagePath.length-1)!="/"){this.imagePath+="/"}this.iconUp=this.imagePath+(this.iconUp||"up2.gif");this.iconDown=this.imagePath+(this.iconDown||"down2.gif");this.iconLeft=this.imagePath+(this.iconLeft||"left2.gif");this.iconRight=this.imagePath+(this.iconRight||"right2.gif");this.iconTop=this.imagePath+(this.iconTop||"top2.gif");this.iconBottom=this.imagePath+(this.iconBottom||"bottom2.gif");var f=c.getEl();this.toTopIcon=f.createChild({tag:"img",src:this.iconTop,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.upIcon=f.createChild({tag:"img",src:this.iconUp,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.addIcon=f.createChild({tag:"img",src:this.iconRight,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.removeIcon=f.createChild({tag:"img",src:this.iconLeft,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.downIcon=f.createChild({tag:"img",src:this.iconDown,style:{cursor:"pointer",margin:"2px"}});f.createChild({tag:"br"});this.toBottomIcon=f.createChild({tag:"img",src:this.iconBottom,style:{cursor:"pointer",margin:"2px"}});this.toTopIcon.on("click",this.toTop,this);this.upIcon.on("click",this.up,this);this.downIcon.on("click",this.down,this);this.toBottomIcon.on("click",this.toBottom,this);this.addIcon.on("click",this.fromTo,this);this.removeIcon.on("click",this.toFrom,this);if(!this.drawUpIcon||this.hideNavIcons){this.upIcon.dom.style.display="none"}if(!this.drawDownIcon||this.hideNavIcons){this.downIcon.dom.style.display="none"}if(!this.drawLeftIcon||this.hideNavIcons){this.addIcon.dom.style.display="none"}if(!this.drawRightIcon||this.hideNavIcons){this.removeIcon.dom.style.display="none"}if(!this.drawTopIcon||this.hideNavIcons){this.toTopIcon.dom.style.display="none"}if(!this.drawBotIcon||this.hideNavIcons){this.toBottomIcon.dom.style.display="none"}var b=g.body.first();this.el.setWidth(g.body.first().getWidth());g.body.removeClass();this.hiddenName=this.name;var e={tag:"input",type:"hidden",value:"",name:this.name};this.hiddenField=this.el.createChild(e)},doLayout:function(){if(this.rendered){this.fromMultiselect.fs.doLayout();this.toMultiselect.fs.doLayout()}},afterRender:function(){Ext.ux.form.ItemSelector.superclass.afterRender.call(this);this.toStore=this.toMultiselect.store;this.toStore.on("add",this.valueChanged,this);this.toStore.on("remove",this.valueChanged,this);this.toStore.on("load",this.valueChanged,this);this.valueChanged(this.toStore)},toTop:function(){var c=this.toMultiselect.view.getSelectedIndexes();var a=[];if(c.length>0){c.sort();for(var b=0;b-1;b--){record=a[b];this.toMultiselect.view.store.remove(record);this.toMultiselect.view.store.insert(0,record);c.push(((a.length-1)-b))}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(c)},toBottom:function(){var c=this.toMultiselect.view.getSelectedIndexes();var a=[];if(c.length>0){c.sort();for(var b=0;b0){for(var b=0;b=0){this.toMultiselect.view.store.remove(a);this.toMultiselect.view.store.insert(c[b]-1,a);d.push(c[b]-1)}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(d)}},down:function(){var a=null;var c=this.toMultiselect.view.getSelectedIndexes();c.sort();c.reverse();var d=[];if(c.length>0){for(var b=0;b0){for(var d=0;d0){for(var c=0;c','
    ','
    {lockedHeader}
    ','
    {lockedBody}
    ',"
    ",'
    ','
    {header}
    ','
    {body}
    ',"
    ",'
     
    ','
     
    ',"")}this.templates=a;Ext.ux.grid.LockingGridView.superclass.initTemplates.call(this)},getEditorParent:function(a){return this.el.dom},initElements:function(){var c=Ext.Element,b=this.grid.getGridEl().dom.firstChild,a=b.childNodes;this.el=new c(b);this.lockedWrap=new c(a[0]);this.lockedHd=new c(this.lockedWrap.dom.firstChild);this.lockedInnerHd=this.lockedHd.dom.firstChild;this.lockedScroller=new c(this.lockedWrap.dom.childNodes[1]);this.lockedBody=new c(this.lockedScroller.dom.firstChild);this.mainWrap=new c(a[1]);this.mainHd=new c(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.lockedHd.setDisplayed(false);this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new c(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new c(this.scroller.dom.firstChild);this.focusEl=new c(this.scroller.dom.childNodes[1]);this.resizeMarker=new c(a[2]);this.resizeProxy=new c(a[3]);this.focusEl.swallowEvent("click",true)},getLockedRows:function(){return this.hasRows()?this.lockedBody.dom.childNodes:[]},getLockedRow:function(a){return this.getLockedRows()[a]},getCell:function(c,a){var b=this.cm.getLockedCount();if(af){a.setHeight(h)}else{if(f>h){b.setHeight(f)}}}}if(k===0){Ext.fly(m[0]).addClass(this.firstRowCls);Ext.fly(e[0]).addClass(this.firstRowCls)}Ext.fly(m[m.length-1]).addClass(this.lastRowCls);Ext.fly(e[e.length-1]).addClass(this.lastRowCls)},afterRender:function(){if(!this.ds||!this.cm){return}var a=this.renderRows()||[" "," "];this.mainBody.dom.innerHTML=a[0];this.lockedBody.dom.innerHTML=a[1];this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}this.grid.fireEvent("viewready",this.grid)},renderUI:function(){var d=this.renderHeaders();var a=this.templates.body.apply({rows:" "});var b=this.templates.master.apply({body:a,header:d[0],ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";",lockedBody:a,lockedHeader:d[1],lstyle:"width:"+this.getLockedWidth()+";"});var c=this.grid;c.getGridEl().dom.innerHTML=b;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);Ext.fly(this.lockedInnerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.lockedHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(c.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(c,this.mainHd.dom);this.splitZone.setOuterHandleElId(Ext.id(this.lockedHd.dom));this.splitZone.setOuterHandleElId(Ext.id(this.mainHd.dom))}if(c.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(c,this.innerHd);this.columnDrag.setOuterHandleElId(Ext.id(this.lockedInnerHd));this.columnDrag.setOuterHandleElId(Ext.id(this.innerHd));this.columnDrop=new Ext.grid.HeaderDropZone(c,this.mainHd.dom)}if(c.enableHdMenu!==false){this.hmenu=new Ext.menu.Menu({id:c.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(this.grid.enableColLock!==false){this.hmenu.add("-",{itemId:"lock",text:this.lockText,cls:"xg-hmenu-lock"},{itemId:"unlock",text:this.unlockText,cls:"xg-hmenu-unlock"})}if(c.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:c.id+"-hcols-menu"});this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick});this.hmenu.add("-",{itemId:"columns",hideOnClick:false,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(c.trackMouseOver){this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut});this.lockedBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut})}if(c.enableDragDrop||c.enableDrag){this.dragZone=new Ext.grid.GridDragZone(c,{ddGroup:c.ddGroup||"GridDD"})}this.updateHeaderSortState()},layout:function(){if(!this.mainBody){return}var d=this.grid;var h=d.getGridEl();var a=h.getSize(true);var b=a.width;if(!d.hideHeaders&&(b<20||a.height<20)){return}this.syncHeaderHeight();if(d.autoHeight){this.scroller.dom.style.overflow="visible";this.lockedScroller.dom.style.overflow="visible";if(Ext.isWebKit){this.scroller.dom.style.position="static";this.lockedScroller.dom.style.position="static"}}else{this.el.setSize(a.width,a.height);var f=this.mainHd.getHeight();var e=a.height-(f)}this.updateLockedWidth();if(this.forceFit){if(this.lastViewWidth!=b){this.fitColumns(false,false);this.lastViewWidth=b}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(b,e)},getOffsetWidth:function(){return(this.cm.getTotalWidth()-this.cm.getTotalLockedWidth()+this.getScrollOffset())+"px"},renderHeaders:function(){var h=this.cm,f=this.templates,d=f.hcell,b=[],g=[],a={},e=h.getColumnCount(),j=e-1;for(var c=0;c=c){this.refresh()}else{if(!f){this.fireEvent("beforerowsinserted",this,g,d)}var b=this.renderRows(g,d),e=this.getRow(g);if(e){if(g===0){this.removeRowClass(0,this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",e,b[0]);e=this.getLockedRow(g);Ext.DomHelper.insertHtml("beforeBegin",e,b[1])}else{this.removeRowClass(c-1,this.lastRowCls);Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b[0]);Ext.DomHelper.insertHtml("beforeEnd",this.lockedBody.dom,b[1])}if(!f){this.fireEvent("rowsinserted",this,g,d);this.processRows(g)}else{if(g===0||g>=c){this.addRowClass(g,g===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(g)},getColumnStyle:function(a,c){var b=!c?this.cm.config[a].cellStyle||this.cm.config[a].css||"":this.cm.config[a].headerStyle||"";b+="width:"+this.getColumnWidth(a)+";";if(this.cm.isHidden(a)){b+="display:none;"}var d=this.cm.config[a].align;if(d){b+="text-align:"+d+";"}return b},getLockedWidth:function(){return this.cm.getTotalLockedWidth()+"px"},getTotalWidth:function(){return(this.cm.getTotalWidth()-this.cm.getTotalLockedWidth())+"px"},getColumnData:function(){var d=[],a=this.cm,e=a.getColumnCount();for(var c=0;cc?b:c)+"px";this.innerHd.firstChild.firstChild.style.height=a;this.lockedInnerHd.firstChild.firstChild.style.height=a},updateLockedWidth:function(){var g=this.cm.getTotalLockedWidth(),a=this.cm.getTotalWidth()-g,c=this.grid.getGridEl().getSize(true),b=Ext.isBorderBox?0:this.lockedBorderWidth,d=Ext.isBorderBox?0:this.rowBorderWidth,e=(c.width-g-b-d)+"px",f=this.getScrollOffset();if(!this.grid.autoHeight){var h=(c.height-this.mainHd.getHeight())+"px";this.lockedScroller.dom.style.height=h;this.scroller.dom.style.height=h}this.lockedWrap.dom.style.width=(g+d)+"px";this.scroller.dom.style.width=e;this.mainWrap.dom.style.left=(g+b+d)+"px";if(this.innerHd){this.lockedInnerHd.firstChild.style.width=g+"px";this.lockedInnerHd.firstChild.firstChild.style.width=g+"px";this.innerHd.style.width=e;this.innerHd.firstChild.style.width=(a+d+f)+"px";this.innerHd.firstChild.firstChild.style.width=a+"px"}if(this.mainBody){this.lockedBody.dom.style.width=(g+d)+"px";this.mainBody.dom.style.width=(a+d)+"px"}}});Ext.ux.grid.LockingColumnModel=Ext.extend(Ext.grid.ColumnModel,{isLocked:function(a){return this.config[a].locked===true},setLocked:function(b,c,a){if(this.isLocked(b)==c){return}this.config[b].locked=c;if(!a){this.fireEvent("columnlockchange",this,b,c)}},getTotalLockedWidth:function(){var b=0;for(var c=0,a=this.config.length;cc&&!a&&b){this.setLocked(d,true,true)}}Ext.ux.grid.LockingColumnModel.superclass.moveColumn.apply(this,arguments)}});Ext.ns("Ext.ux.form");Ext.ux.form.MultiSelect=Ext.extend(Ext.form.Field,{ddReorder:false,appendOnly:false,width:100,height:100,displayField:0,valueField:1,allowBlank:true,minSelections:0,maxSelections:Number.MAX_VALUE,blankText:Ext.form.TextField.prototype.blankText,minSelectionsText:"Minimum {0} item(s) required",maxSelectionsText:"Maximum {0} item(s) allowed",delimiter:",",defaultAutoCreate:{tag:"div"},initComponent:function(){Ext.ux.form.MultiSelect.superclass.initComponent.call(this);if(Ext.isArray(this.store)){if(Ext.isArray(this.store[0])){this.store=new Ext.data.ArrayStore({fields:["value","text"],data:this.store});this.valueField="value"}else{this.store=new Ext.data.ArrayStore({fields:["text"],data:this.store,expandData:true});this.valueField="text"}this.displayField="text"}else{this.store=Ext.StoreMgr.lookup(this.store)}this.addEvents({dblclick:true,click:true,change:true,drop:true})},onRender:function(c,b){Ext.ux.form.MultiSelect.superclass.onRender.call(this,c,b);var a=this.fs=new Ext.form.FieldSet({renderTo:this.el,title:this.legend,height:this.height,width:this.width,style:"padding:0;",tbar:this.tbar});a.body.addClass("ux-mselect");this.view=new Ext.ListView({multiSelect:true,store:this.store,columns:[{header:"Value",width:1,dataIndex:this.displayField}],hideHeaders:true});a.add(this.view);this.view.on("click",this.onViewClick,this);this.view.on("beforeclick",this.onViewBeforeClick,this);this.view.on("dblclick",this.onViewDblClick,this);this.hiddenName=this.name||Ext.id();var d={tag:"input",type:"hidden",value:"",name:this.hiddenName};this.hiddenField=this.el.createChild(d);this.hiddenField.dom.disabled=this.hiddenName!=this.name;a.doLayout()},afterRender:function(){Ext.ux.form.MultiSelect.superclass.afterRender.call(this);if(this.ddReorder&&!this.dragGroup&&!this.dropGroup){this.dragGroup=this.dropGroup="MultiselectDD-"+Ext.id()}if(this.draggable||this.dragGroup){this.dragZone=new Ext.ux.form.MultiSelect.DragZone(this,{ddGroup:this.dragGroup})}if(this.droppable||this.dropGroup){this.dropZone=new Ext.ux.form.MultiSelect.DropZone(this,{ddGroup:this.dropGroup})}},onViewClick:function(c,a,b,d){this.fireEvent("change",this,this.getValue(),this.hiddenField.dom.value);this.hiddenField.dom.value=this.getValue();this.fireEvent("click",this,d);this.validate()},onViewBeforeClick:function(c,a,b,d){if(this.disabled||this.readOnly){return false}},onViewDblClick:function(c,a,b,d){return this.fireEvent("dblclick",c,a,b,d)},getValue:function(a){var d=[];var c=this.view.getSelectedIndexes();if(c.length==0){return""}for(var b=0;bthis.maxSelections){this.markInvalid(String.format(this.maxSelectionsText,this.maxSelections));return false}return true},disable:function(){this.disabled=true;this.hiddenField.dom.disabled=true;this.fs.disable()},enable:function(){this.disabled=false;this.hiddenField.dom.disabled=false;this.fs.enable()},destroy:function(){Ext.destroy(this.fs,this.dragZone,this.dropZone);Ext.ux.form.MultiSelect.superclass.destroy.call(this)}});Ext.reg("multiselect",Ext.ux.form.MultiSelect);Ext.ux.Multiselect=Ext.ux.form.MultiSelect;Ext.ux.form.MultiSelect.DragZone=function(d,c){this.ms=d;this.view=d.view;var b=c.ddGroup||"MultiselectDD";var a;if(Ext.isArray(b)){a=b.shift()}else{a=b;b=null}Ext.ux.form.MultiSelect.DragZone.superclass.constructor.call(this,this.ms.fs.body,{containerScroll:true,ddGroup:a});this.setDraggable(b)};Ext.extend(Ext.ux.form.MultiSelect.DragZone,Ext.dd.DragZone,{onInitDrag:function(a,c){var b=Ext.get(this.dragData.ddel.cloneNode(true));this.proxy.update(b.dom);b.setWidth(b.child("em").getWidth());this.onStartDrag(a,c);return true},collectSelection:function(b){b.repairXY=Ext.fly(this.view.getSelectedNodes()[0]).getXY();var a=0;this.view.store.each(function(d){if(this.view.isSelected(a)){var e=this.view.getNode(a);var c=e.cloneNode(true);c.id=Ext.id();b.ddel.appendChild(c);b.records.push(this.view.store.getAt(a));b.viewNodes.push(e)}a++},this)},onEndDrag:function(a,b){var c=Ext.get(this.dragData.ddel);if(c&&c.hasClass("multi-proxy")){c.remove()}},getDragData:function(d){var c=this.view.findItemFromChild(d.getTarget());if(c){if(!this.view.isSelected(c)&&!d.ctrlKey&&!d.shiftKey){this.view.select(c);this.ms.setValue(this.ms.getValue())}if(this.view.getSelectionCount()==0||d.ctrlKey||d.shiftKey){return false}var b={sourceView:this.view,viewNodes:[],records:[]};if(this.view.getSelectionCount()==1){var a=this.view.getSelectedIndexes()[0];var f=this.view.getNode(a);b.viewNodes.push(b.ddel=f);b.records.push(this.view.store.getAt(a));b.repairXY=Ext.fly(f).getXY()}else{b.ddel=document.createElement("div");b.ddel.className="multi-proxy";this.collectSelection(b)}return b}return false},getRepairXY:function(a){return this.dragData.repairXY},setDraggable:function(a){if(!a){return}if(Ext.isArray(a)){Ext.each(a,this.setDraggable,this);return}this.addToGroup(a)}});Ext.ux.form.MultiSelect.DropZone=function(d,c){this.ms=d;this.view=d.view;var b=c.ddGroup||"MultiselectDD";var a;if(Ext.isArray(b)){a=b.shift()}else{a=b;b=null}Ext.ux.form.MultiSelect.DropZone.superclass.constructor.call(this,this.ms.fs.body,{containerScroll:true,ddGroup:a});this.setDroppable(b)};Ext.extend(Ext.ux.form.MultiSelect.DropZone,Ext.dd.DropZone,{getTargetFromEvent:function(b){var a=b.getTarget();return a},getDropPoint:function(g,k,d){if(k==this.ms.fs.body.dom){return"below"}var f=Ext.lib.Dom.getY(k),a=f+k.offsetHeight;var j=f+(a-f)/2;var h=Ext.lib.Event.getPageY(g);if(h<=j){return"above"}else{return"below"}},isValidDropPoint:function(b,e,a){if(!a.viewNodes||(a.viewNodes.length!=1)){return true}var c=a.viewNodes[0];if(c==e){return false}if((b=="below")&&(e.nextSibling==c)){return false}if((b=="above")&&(e.previousSibling==c)){return false}return true},onNodeEnter:function(d,a,c,b){return false},onNodeOver:function(h,a,g,d){var b=this.dropNotAllowed;var f=this.getDropPoint(g,h,a);if(this.isValidDropPoint(f,h,d)){if(this.ms.appendOnly){return"x-tree-drop-ok-below"}if(f){var c;if(f=="above"){b=h.previousSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-above";c="x-view-drag-insert-above"}else{b=h.nextSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-below";c="x-view-drag-insert-below"}if(this.lastInsertClass!=c){Ext.fly(h).replaceClass(this.lastInsertClass,c);this.lastInsertClass=c}}}return b},onNodeOut:function(d,a,c,b){this.removeDropIndicators(d)},onNodeDrop:function(b,j,h,f){if(this.ms.fireEvent("drop",this,b,j,h,f)===false){return false}var k=this.getDropPoint(h,b,j);if(b!=this.ms.fs.body.dom){b=this.view.findItemFromChild(b)}if(this.ms.appendOnly){insertAt=this.view.store.getCount()}else{insertAt=b==this.ms.fs.body.dom?this.view.store.getCount()-1:this.view.indexOf(b);if(k=="below"){insertAt++}}var c=false;if(f.sourceView==this.view){if(k=="below"){if(f.viewNodes[0]==b){f.viewNodes.shift()}}else{if(f.viewNodes[f.viewNodes.length-1]==b){f.viewNodes.pop()}}if(!f.viewNodes.length){return false}if(insertAt>this.view.store.indexOf(f.records[0])){c="down";insertAt--}}for(var g=0;ge?1:(nf[1]){l=true;break}}}j=(l&&r?j:v.items.getCount())+(k?-1:0);var g=this.createEvent(w,u,x,d,v,j);if(a.fireEvent("validatedrop",g)!==false&&a.fireEvent("beforedragover",g)!==false){o.getProxy().setWidth("auto");if(r){o.moveProxy(r.el.dom.parentNode,l?r.el.dom:null)}else{o.moveProxy(v.el.dom,null)}this.lastPos={c:v,col:d,p:k||(l&&r)?j:false};this.scrollPos=a.body.getScroll();a.fireEvent("dragover",g);return g.status}else{return g.status}},notifyOut:function(){delete this.grid},notifyDrop:function(m,h,g){delete this.grid;if(!this.lastPos){return}var k=this.lastPos.c,f=this.lastPos.col,l=this.lastPos.p,a=m.panel,b=this.createEvent(m,h,g,f,k,l!==false?l:k.items.getCount());if(this.portal.fireEvent("validatedrop",b)!==false&&this.portal.fireEvent("beforedrop",b)!==false){m.proxy.getProxy().remove();a.el.dom.parentNode.removeChild(m.panel.el.dom);if(l!==false){k.insert(l,a)}else{k.add(a)}k.doLayout();this.portal.fireEvent("drop",b);var n=this.scrollPos.top;if(n){var j=this.portal.body.dom;setTimeout(function(){j.scrollTop=n},10)}}delete this.lastPos},getGrid:function(){var a=this.portal.bwrap.getBox();a.columnX=[];this.portal.items.each(function(b){a.columnX.push({x:b.el.getX(),w:b.el.getWidth()})});return a},unreg:function(){Ext.dd.ScrollManager.unregister(this.portal.body);Ext.ux.Portal.DropZone.superclass.unreg.call(this)}});Ext.ux.PortalColumn=Ext.extend(Ext.Container,{layout:"anchor",defaultType:"portlet",cls:"x-portal-column"});Ext.reg("portalcolumn",Ext.ux.PortalColumn);Ext.ux.Portlet=Ext.extend(Ext.Panel,{anchor:"100%",frame:true,collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("portlet",Ext.ux.Portlet);Ext.ux.ProgressBarPager=Ext.extend(Object,{progBarWidth:225,defaultText:"Loading...",defaultAnimCfg:{duration:1,easing:"bounceOut"},constructor:function(a){if(a){Ext.apply(this,a)}},init:function(a){if(a.displayInfo){this.parent=a;var b=a.items.indexOf(a.displayItem);a.remove(a.displayItem,true);this.progressBar=new Ext.ProgressBar({text:this.defaultText,width:this.progBarWidth,animate:this.defaultAnimCfg});a.displayItem=this.progressBar;a.add(a.displayItem);a.doLayout();Ext.apply(a,this.parentOverrides);this.progressBar.on("render",function(c){c.mon(c.getEl().applyStyles("cursor:pointer"),"click",this.handleProgressBarClick,this)},this,{single:true})}},handleProgressBarClick:function(j){var d=this.parent,c=d.displayItem,f=this.progressBar.getBox(),h=j.getXY(),b=h[0]-f.x,a=Math.ceil(d.store.getTotalCount()/d.pageSize),g=Math.ceil(b/(c.width/a));d.changePage(g)},parentOverrides:{updateInfo:function(){if(this.displayItem){var b=this.store.getCount(),a=this.getPageData(),d=this.readPage(a),e=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());d=a.activePage;var c=d/a.pages;this.displayItem.updateProgress(c,e,this.animate||this.defaultAnimConfig)}}}});Ext.preg("progressbarpager",Ext.ux.ProgressBarPager);Ext.ns("Ext.ux.grid");Ext.ux.grid.RowEditor=Ext.extend(Ext.Panel,{floating:true,shadow:false,layout:"hbox",cls:"x-small-editor",buttonAlign:"center",baseCls:"x-row-editor",elements:"header,footer,body",frameWidth:5,buttonPad:3,clicksToEdit:"auto",monitorValid:true,focusDelay:250,errorSummary:true,saveText:"Save",cancelText:"Cancel",commitChangesText:"You need to commit or cancel your changes",errorText:"Errors",defaults:{normalWidth:true},initComponent:function(){Ext.ux.grid.RowEditor.superclass.initComponent.call(this);this.addEvents("beforeedit","canceledit","validateedit","afteredit")},init:function(a){this.grid=a;this.ownerCt=a;if(this.clicksToEdit===2){a.on("rowdblclick",this.onRowDblClick,this)}else{a.on("rowclick",this.onRowClick,this);if(Ext.isIE){a.on("rowdblclick",this.onRowDblClick,this)}}a.getStore().on("remove",function(){this.stopEditing(false)},this);a.on({scope:this,keydown:this.onGridKey,columnresize:this.verifyLayout,columnmove:this.refreshFields,reconfigure:this.refreshFields,beforedestroy:this.beforedestroy,destroy:this.destroy,bodyscroll:{buffer:250,fn:this.positionButtons}});a.getColumnModel().on("hiddenchange",this.verifyLayout,this,{delay:1});a.getView().on("refresh",this.stopEditing.createDelegate(this,[]))},beforedestroy:function(){this.stopMonitoring();this.grid.getStore().un("remove",this.onStoreRemove,this);this.stopEditing(false);Ext.destroy(this.btns,this.tooltip)},refreshFields:function(){this.initFields();this.verifyLayout()},isDirty:function(){var a;this.items.each(function(b){if(String(this.values[b.id])!==String(b.getValue())){a=true;return false}},this);return a},startEditing:function(k,p){if(this.editing&&this.isDirty()){this.showTooltip(this.commitChangesText);return}if(Ext.isObject(k)){k=this.grid.getStore().indexOf(k)}if(this.fireEvent("beforeedit",this,k)!==false){this.editing=true;var e=this.grid,l=e.getView(),o=l.getRow(k),c=e.store.getAt(k);this.record=c;this.rowIndex=k;this.values={};if(!this.rendered){this.render(l.getEditorParent())}var m=Ext.fly(o).getWidth();this.setSize(m);if(!this.initialized){this.initFields()}var n=e.getColumnModel(),d=this.items.items,j,a;for(var b=0,h=n.getColumnCount();b=h){d=b;break}}}return d},startMonitoring:function(){if(!this.bound&&this.monitorValid){this.bound=true;Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){this.bound=false;if(this.tooltip){this.tooltip.hide()}},isValid:function(){var a=true;this.items.each(function(b){if(!b.isValid(true)){a=false;return false}});return a},bindHandler:function(){if(!this.bound){return false}var a=this.isValid();if(!a&&this.errorSummary){this.showTooltip(this.getErrorText().join(""))}this.btns.saveBtn.setDisabled(!a);this.fireEvent("validation",this,a)},lastVisibleColumn:function(){var a=this.items.getCount()-1,b;for(;a>=0;a--){b=this.items.items[a];if(!b.hidden){return b}}},showTooltip:function(f){var c=this.tooltip;if(!c){c=this.tooltip=new Ext.ToolTip({maxWidth:600,cls:"errorTip",width:300,title:this.errorText,autoHide:false,anchor:"left",anchorToTarget:true,mouseOffset:[40,0]})}var b=this.grid.getView(),e=parseInt(this.el.dom.style.top,10),a=b.scroller.dom.scrollTop,d=this.el.getHeight();if(e+d>=a){c.initTarget(this.lastVisibleColumn().getEl());if(!c.rendered){c.show();c.hide()}c.body.update(f);c.doAutoWidth(20);c.show()}else{if(c.rendered){c.hide()}}},getErrorText:function(){var a=["
      "];this.items.each(function(b){if(!b.isValid(true)){a.push("
    • ",b.getActiveError(),"
    • ")}});a.push("
    ");return a}});Ext.preg("roweditor",Ext.ux.grid.RowEditor);Ext.ns("Ext.ux.grid");Ext.ux.grid.RowExpander=Ext.extend(Ext.util.Observable,{expandOnEnter:true,expandOnDblClick:true,header:"",width:20,sortable:false,fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"expander",lazyRender:true,enableCaching:true,constructor:function(a){Ext.apply(this,a);this.addEvents({beforeexpand:true,expand:true,beforecollapse:true,collapse:true});Ext.ux.grid.RowExpander.superclass.constructor.call(this);if(this.tpl){if(typeof this.tpl=="string"){this.tpl=new Ext.Template(this.tpl)}this.tpl.compile()}this.state={};this.bodyContent={}},getRowClass:function(a,e,d,c){d.cols=d.cols-1;var b=this.bodyContent[a.id];if(!b&&!this.lazyRender){b=this.getBodyContent(a,e)}if(b){d.body=b}return this.state[a.id]?"x-grid3-row-expanded":"x-grid3-row-collapsed"},init:function(b){this.grid=b;var a=b.getView();a.getRowClass=this.getRowClass.createDelegate(this);a.enableRowBody=true;b.on("render",this.onRender,this);b.on("destroy",this.onDestroy,this)},onRender:function(){var a=this.grid;var b=a.getView().mainBody;b.on("mousedown",this.onMouseDown,this,{delegate:".x-grid3-row-expander"});if(this.expandOnEnter){this.keyNav=new Ext.KeyNav(this.grid.getGridEl(),{enter:this.onEnter,scope:this})}if(this.expandOnDblClick){a.on("rowdblclick",this.onRowDblClick,this)}},onDestroy:function(){if(this.keyNav){this.keyNav.disable();delete this.keyNav}var a=this.grid.getView().mainBody;if(a){a.un("mousedown",this.onMouseDown,this)}},onRowDblClick:function(a,b,c){this.toggleRow(b)},onEnter:function(h){var f=this.grid;var j=f.getSelectionModel();var b=j.getSelections();for(var c=0,a=b.length;c '},beforeExpand:function(b,a,c){if(this.fireEvent("beforeexpand",this,b,a,c)!==false){if(this.tpl&&this.lazyRender){a.innerHTML=this.getBodyContent(b,c)}return true}else{return false}},toggleRow:function(a){if(typeof a=="number"){a=this.grid.view.getRow(a)}this[Ext.fly(a).hasClass("x-grid3-row-collapsed")?"expandRow":"collapseRow"](a)},expandRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c)}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.DomQuery.selectNode("tr:nth(2) div.x-grid3-row-body",c);if(this.beforeExpand(b,a,c.rowIndex)){this.state[b.id]=true;Ext.fly(c).replaceClass("x-grid3-row-collapsed","x-grid3-row-expanded");this.fireEvent("expand",this,b,a,c.rowIndex)}},collapseRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c)}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.fly(c).child("tr:nth(1) div.x-grid3-row-body",true);if(this.fireEvent("beforecollapse",this,b,a,c.rowIndex)!==false){this.state[b.id]=false;Ext.fly(c).replaceClass("x-grid3-row-expanded","x-grid3-row-collapsed");this.fireEvent("collapse",this,b,a,c.rowIndex)}}});Ext.preg("rowexpander",Ext.ux.grid.RowExpander);Ext.grid.RowExpander=Ext.ux.grid.RowExpander;Ext.ns("Ext.ux.layout");Ext.ux.layout.RowLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"row",allowContainerRemove:false,isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.height==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(g,k){var c=g.items.items,j=c.length,a,b,d,n=[];this.renderAll(g,k);var o=this.getLayoutTargetSize();if(o.width<1&&o.height<1){return}var e=o.height,f=e;this.innerCt.setSize({height:e});for(d=0;d{0} of {1}",d.value,d.slider.maxValue)}}),listeners:{changecomplete:function(e,d){b.changePage(d)}}});b.insert(a+1,c);b.on({change:function(d,e){c.setMaxValue(e.pages);c.setValue(e.activePage)}})}});Ext.ns("Ext.ux.form");Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:"wrap",deferHeight:true,autoSize:Ext.emptyFn,onBlur:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(c){var b=Ext.copyTo({},c,"incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass");var d=this.spinner=new Ext.ux.Spinner(b);var a=c.plugins?(Ext.isArray(c.plugins)?c.plugins.push(d):[c.plugins,d]):d;Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(c,{plugins:a}))},getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},validateBlur:function(){return true}});Ext.reg("spinnerfield",Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,defaultValue:0,accelerate:false,constructor:function(a){Ext.ux.Spinner.superclass.constructor.call(this,a);Ext.apply(this,a);this.mimicing=false},init:function(a){this.field=a;a.afterMethod("onRender",this.doRender,this);a.afterMethod("onEnable",this.doEnable,this);a.afterMethod("onDisable",this.doDisable,this);a.afterMethod("afterRender",this.doAfterRender,this);a.afterMethod("onResize",this.doResize,this);a.afterMethod("onFocus",this.doFocus,this);a.beforeMethod("onDestroy",this.doDestroy,this)},doRender:function(b,a){var c=this.el=this.field.getEl();var d=this.field;if(!d.wrap){d.wrap=this.wrap=c.wrap({cls:"x-form-field-wrap"})}else{this.wrap=d.wrap.addClass("x-form-field-wrap")}this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(!d.width){this.wrap.setWidth(c.getWidth()+this.trigger.getWidth())}this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});this.splitter.setRight((Ext.isIE)?1:2).setTop(10).show();this.proxy=this.trigger.createProxy("",this.splitter,true);this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle("left","0px");this.proxy.setSize(14,1);this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});this.initTrigger();this.initSpinner()},doAfterRender:function(){var a;if(Ext.isIE&&this.el.getY()!=(a=this.trigger.getY())){this.el.position();this.el.setY(a)}},doEnable:function(){if(this.wrap){this.wrap.removeClass(this.field.disabledClass)}},doDisable:function(){if(this.wrap){this.wrap.addClass(this.field.disabledClass);this.el.removeClass(this.field.disabledClass)}},doResize:function(a,b){if(typeof a=="number"){this.el.setWidth(a-this.trigger.getWidth())}this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},doFocus:function(){if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});this.el.on("keydown",this.checkTab,this)}},checkTab:function(a){if(a.getKey()==a.TAB){this.triggerBlur()}},mimicBlur:function(a){if(!this.wrap.contains(a.target)&&this.field.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab,this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");this.field.onBlur.call(this.field)},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){this.field.addEvents({spin:true,spinup:true,spindown:true});this.keyNav=new Ext.KeyNav(this.el,{up:function(a){a.preventDefault();this.onSpinUp()},down:function(a){a.preventDefault();this.onSpinDown()},pageUp:function(a){a.preventDefault();this.onSpinUpAlternate()},pageDown:function(a){a.preventDefault();this.onSpinDownAlternate()},scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:true});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:true});this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this);this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);this.dd.onDrag=this.onDrag.createDelegate(this)},onMouseOver:function(){if(this.disabled){return}var a=this.getMiddle();this.tmpHoverClass=(Ext.EventObject.getPageY()a)&&this.tmpHoverClass=="x-form-spinner-overup")||((Ext.EventObject.getPageY()0){this.onSpinUp();a.stopEvent()}else{if(b<0){this.onSpinDown();a.stopEvent()}}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop()},endDrag:function(){this.proxy.hide()},onDrag:function(){if(this.disabled){return}var b=Ext.fly(this.dd.getDragEl()).getTop();var a="";if(this._previousY>b){a="Up"}if(this._previousYthis.field.maxValue){a=this.field.maxValue}return this.fixPrecision(a)},fixPrecision:function(b){var a=isNaN(b);if(!this.field.allowDecimals||this.field.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.field.decimalPrecision))},doDestroy:function(){if(this.trigger){this.trigger.remove()}if(this.wrap){this.wrap.remove();delete this.field.wrap}if(this.splitter){this.splitter.remove()}if(this.dd){this.dd.unreg();this.dd=null}if(this.proxy){this.proxy.remove()}if(this.repeater){this.repeater.purgeListeners()}}});Ext.form.Spinner=Ext.ux.Spinner;Ext.ux.Spotlight=function(a){Ext.apply(this,a)};Ext.ux.Spotlight.prototype={active:false,animate:true,duration:0.25,easing:"easeNone",animated:false,createElements:function(){var a=Ext.getBody();this.right=a.createChild({cls:"x-spotlight"});this.left=a.createChild({cls:"x-spotlight"});this.top=a.createChild({cls:"x-spotlight"});this.bottom=a.createChild({cls:"x-spotlight"});this.all=new Ext.CompositeElement([this.right,this.left,this.top,this.bottom])},show:function(b,c,a){if(this.animated){this.show.defer(50,this,[b,c,a]);return}this.el=Ext.get(b);if(!this.right){this.createElements()}if(!this.active){this.all.setDisplayed("");this.applyBounds(true,false);this.active=true;Ext.EventManager.onWindowResize(this.syncSize,this);this.applyBounds(false,this.animate,false,c,a)}else{this.applyBounds(false,false,false,c,a)}},hide:function(b,a){if(this.animated){this.hide.defer(50,this,[b,a]);return}Ext.EventManager.removeResizeListener(this.syncSize,this);this.applyBounds(true,this.animate,true,b,a)},doHide:function(){this.active=false;this.all.setDisplayed(false)},syncSize:function(){this.applyBounds(false,false)},applyBounds:function(e,d,k,j,l){var h=this.el.getRegion();var a=Ext.lib.Dom.getViewWidth(true);var g=Ext.lib.Dom.getViewHeight(true);var f=0,b=false;if(d){b={callback:function(){f++;if(f==4){this.animated=false;if(k){this.doHide()}Ext.callback(j,l,[this])}},scope:this,duration:this.duration,easing:this.easing};this.animated=true}this.right.setBounds(h.right,e?g:h.top,a-h.right,e?0:(g-h.top),b);this.left.setBounds(0,0,h.left,e?0:h.bottom,b);this.top.setBounds(e?a:h.left,0,e?0:a-h.left,h.top,b);this.bottom.setBounds(0,h.bottom,e?0:h.right,g-h.bottom,b);if(!d){if(k){this.doHide()}if(j){Ext.callback(j,l,[this])}}},destroy:function(){this.doHide();Ext.destroy(this.right,this.left,this.top,this.bottom);delete this.el;delete this.all}};Ext.Spotlight=Ext.ux.Spotlight;Ext.ux.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5000,emptyText:" ",activeThreadId:0,initComponent:function(){if(this.statusAlign=="right"){this.cls+=" x-status-right"}Ext.ux.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.ux.StatusBar.superclass.afterRender.call(this);var a=this.statusAlign=="right";this.currIconCls=this.iconCls||this.defaultIconCls;this.statusEl=new Ext.Toolbar.TextItem({cls:"x-status-text "+(this.currIconCls||""),text:this.text||this.defaultText||""});if(a){this.add("->");this.add(this.statusEl)}else{this.insert(0,this.statusEl);this.insert(1,"->")}this.doLayout()},setStatus:function(d){d=d||{};if(typeof d=="string"){d={text:d}}if(d.text!==undefined){this.setText(d.text)}if(d.iconCls!==undefined){this.setIcon(d.iconCls)}if(d.clear){var e=d.clear,b=this.autoClear,a={useDefaults:true,anim:true};if(typeof e=="object"){e=Ext.applyIf(e,a);if(e.wait){b=e.wait}}else{if(typeof e=="number"){b=e;e=a}else{if(typeof e=="boolean"){e=a}}}e.threadId=this.activeThreadId;this.clearStatus.defer(b,this,[e])}return this},clearStatus:function(c){c=c||{};if(c.threadId&&c.threadId!==this.activeThreadId){return this}var b=c.useDefaults?this.defaultText:this.emptyText,a=c.useDefaults?(this.defaultIconCls?this.defaultIconCls:""):"";if(c.anim){this.statusEl.el.fadeOut({remove:false,useDisplay:true,scope:this,callback:function(){this.setStatus({text:b,iconCls:a});this.statusEl.el.show()}})}else{this.statusEl.hide();this.setStatus({text:b,iconCls:a});this.statusEl.show()}return this},setText:function(a){this.activeThreadId++;this.text=a||"";if(this.rendered){this.statusEl.setText(this.text)}return this},getText:function(){return this.text},setIcon:function(a){this.activeThreadId++;a=a||"";if(this.rendered){if(this.currIconCls){this.statusEl.removeClass(this.currIconCls);this.currIconCls=null}if(a.length>0){this.statusEl.addClass(a);this.currIconCls=a}}else{this.currIconCls=a}return this},showBusy:function(a){if(typeof a=="string"){a={text:a}}a=Ext.applyIf(a||{},{text:this.busyText,iconCls:this.busyIconCls});return this.setStatus(a)}});Ext.reg("statusbar",Ext.ux.StatusBar);Ext.ux.TabCloseMenu=Ext.extend(Object,{closeTabText:"Close Tab",closeOtherTabsText:"Close Other Tabs",showCloseAll:true,closeAllTabsText:"Close All Tabs",constructor:function(a){Ext.apply(this,a||{})},init:function(a){this.tabs=a;a.on({scope:this,contextmenu:this.onContextMenu,destroy:this.destroy})},destroy:function(){Ext.destroy(this.menu);delete this.menu;delete this.tabs;delete this.active},onContextMenu:function(b,c,g){this.active=c;var a=this.createMenu(),d=true,h=true,f=a.getComponent("closeall");a.getComponent("close").setDisabled(!c.closable);b.items.each(function(){if(this.closable){d=false;if(this!=c){h=false;return false}}});a.getComponent("closeothers").setDisabled(h);if(f){f.setDisabled(d)}g.stopEvent();a.showAt(g.getPoint())},createMenu:function(){if(!this.menu){var a=[{itemId:"close",text:this.closeTabText,scope:this,handler:this.onClose}];if(this.showCloseAll){a.push("-")}a.push({itemId:"closeothers",text:this.closeOtherTabsText,scope:this,handler:this.onCloseOthers});if(this.showCloseAll){a.push({itemId:"closeall",text:this.closeAllTabsText,scope:this,handler:this.onCloseAll})}this.menu=new Ext.menu.Menu({items:a})}return this.menu},onClose:function(){this.tabs.remove(this.active)},onCloseOthers:function(){this.doClose(true)},onCloseAll:function(){this.doClose(false)},doClose:function(b){var a=[];this.tabs.items.each(function(c){if(c.closable){if(!b||c!=this.active){a.push(c)}}},this);Ext.each(a,function(c){this.tabs.remove(c)},this)}});Ext.preg("tabclosemenu",Ext.ux.TabCloseMenu);Ext.ns("Ext.ux.grid");Ext.ux.grid.TableGrid=function(p,f){f=f||{};Ext.apply(this,f);var c=f.fields||[],a=f.columns||[];p=Ext.get(p);var k=p.insertSibling();var l=[],m=[];var e=p.query("thead th");for(var g=0,j;j=e[g];g++){var o=j.innerHTML;var b="tcol-"+g;l.push(Ext.applyIf(c[g]||{},{name:b,mapping:"td:nth("+(g+1)+")/@innerHTML"}));m.push(Ext.applyIf(a[g]||{},{header:o,dataIndex:b,width:j.offsetWidth,tooltip:j.title,sortable:true}))}var d=new Ext.data.Store({reader:new Ext.data.XmlReader({record:"tbody tr"},l)});d.loadData(p.dom);var n=new Ext.grid.ColumnModel(m);if(f.width||f.height){k.setSize(f.width||"auto",f.height||"auto")}else{k.setWidth(p.getWidth())}if(f.remove!==false){p.remove()}Ext.applyIf(this,{ds:d,cm:n,sm:new Ext.grid.RowSelectionModel(),autoHeight:true,autoWidth:false});Ext.ux.grid.TableGrid.superclass.constructor.call(this,k,{})};Ext.extend(Ext.ux.grid.TableGrid,Ext.grid.GridPanel);Ext.grid.TableGrid=Ext.ux.grid.TableGrid;Ext.ns("Ext.ux");Ext.ux.TabScrollerMenu=Ext.extend(Object,{pageSize:10,maxText:15,menuPrefixText:"Items",constructor:function(a){a=a||{};Ext.apply(this,a)},init:function(b){Ext.apply(b,this.parentOverrides);b.tabScrollerMenu=this;var a=this;b.on({render:{scope:b,single:true,fn:function(){var c=b.createScrollers.createSequence(a.createPanelsMenu,this);b.createScrollers=c}}})},createPanelsMenu:function(){var c=this.stripWrap.dom.offsetHeight;var b=this.header.dom.firstChild;Ext.fly(b).applyStyles({right:"18px"});var a=Ext.get(this.strip.dom.parentNode);a.applyStyles({"margin-right":"36px"});var d=this.header.insertFirst({cls:"x-tab-tabmenu-right"});d.setHeight(c);d.addClassOnOver("x-tab-tabmenu-over");d.on("click",this.showTabsMenu,this);this.scrollLeft.show=this.scrollLeft.show.createSequence(function(){d.show()});this.scrollLeft.hide=this.scrollLeft.hide.createSequence(function(){d.hide()})},getPageSize:function(){return this.pageSize},setPageSize:function(a){this.pageSize=a},getMaxText:function(){return this.maxText},setMaxText:function(a){this.maxText=a},getMenuPrefixText:function(){return this.menuPrefixText},setMenuPrefixText:function(a){this.menuPrefixText=a},parentOverrides:{showTabsMenu:function(c){if(this.tabsMenu){this.tabsMenu.destroy();this.un("destroy",this.tabsMenu.destroy,this.tabsMenu);this.tabsMenu=null}this.tabsMenu=new Ext.menu.Menu();this.on("destroy",this.tabsMenu.destroy,this.tabsMenu);this.generateTabMenuItems();var b=Ext.get(c.getTarget());var a=b.getXY();a[1]+=24;this.tabsMenu.showAt(a)},generateTabMenuItems:function(){var a=this.getActiveTab();var l=this.items.getCount();var g=this.tabScrollerMenu.getPageSize();if(l>g){var d=Math.floor(l/g);var j=l%g;for(var e=0;e0){var c=d*g;b=[];for(var e=c;e0){var e=this.parseXml(f);if(typeof e=="string"){c.attributes.innerText=e}else{c.appendChild(e)}}a.push(c)}else{if(f.nodeType==this.XML_NODE_TEXT){var d=f.nodeValue.trim();if(d.length>0){return a=d}}}},this);return a},createNode:function(b){var a={tagName:b.tagName};Ext.each(b.attributes,function(c){a[c.nodeName]=c.nodeValue});this.processAttributes(a);return Ext.ux.tree.XmlTreeLoader.superclass.createNode.call(this,a)},processAttributes:Ext.emptyFn});Ext.ux.XmlTreeLoader=Ext.ux.tree.XmlTreeLoader;Ext.ux.ValidationStatus=Ext.extend(Ext.Component,{errorIconCls:"x-status-error",errorListCls:"x-status-error-list",validIconCls:"x-status-valid",showText:"The form has errors (click for details...)",hideText:"Click again to hide the error list",submitText:"Saving...",init:function(a){a.on("render",function(){this.statusBar=a;this.monitor=true;this.errors=new Ext.util.MixedCollection();this.listAlign=(a.statusAlign=="right"?"br-tr?":"bl-tl?");if(this.form){this.form=Ext.getCmp(this.form).getForm();this.startMonitoring();this.form.on("beforeaction",function(d,c){if(c.type=="submit"){this.monitor=false}},this);var b=function(){this.monitor=true};this.form.on("actioncomplete",b,this);this.form.on("actionfailed",b,this)}},this,{single:true});a.on({scope:this,afterlayout:{single:true,fn:function(){a.statusEl.getEl().on("click",this.onStatusClick,this,{buffer:200})}},beforedestroy:{single:true,fn:this.onDestroy}})},startMonitoring:function(){this.form.items.each(function(a){a.on("invalid",this.onFieldValidation,this);a.on("valid",this.onFieldValidation,this)},this)},stopMonitoring:function(){this.form.items.each(function(a){a.un("invalid",this.onFieldValidation,this);a.un("valid",this.onFieldValidation,this)},this)},onDestroy:function(){this.stopMonitoring();this.statusBar.statusEl.un("click",this.onStatusClick,this);Ext.ux.ValidationStatus.superclass.onDestroy.call(this)},onFieldValidation:function(a,b){if(!this.monitor){return false}if(b){this.errors.add(a.id,{field:a,msg:b})}else{this.errors.removeKey(a.id)}this.updateErrorList();if(this.errors.getCount()>0){if(this.statusBar.getText()!=this.showText){this.statusBar.setStatus({text:this.showText,iconCls:this.errorIconCls})}}else{this.statusBar.clearStatus().setIcon(this.validIconCls)}},updateErrorList:function(){if(this.errors.getCount()>0){var a="
      ";this.errors.each(function(b){a+=('
    • '+b.msg+"
    • ")},this);this.getMsgEl().update(a+"
    ")}else{this.getMsgEl().update("")}},getMsgEl:function(){if(!this.msgEl){this.msgEl=Ext.DomHelper.append(Ext.getBody(),{cls:this.errorListCls+" x-hide-offsets"},true);this.msgEl.on("click",function(b){var a=b.getTarget("li",10,true);if(a){Ext.getCmp(a.id.split("x-err-")[1]).focus();this.hideErrors()}},this,{stopEvent:true})}return this.msgEl},showErrors:function(){this.updateErrorList();this.getMsgEl().alignTo(this.statusBar.getEl(),this.listAlign).slideIn("b",{duration:0.3,easing:"easeOut"});this.statusBar.setText(this.hideText);this.form.getEl().on("click",this.hideErrors,this,{single:true})},hideErrors:function(){var a=this.getMsgEl();if(a.isVisible()){a.slideOut("b",{duration:0.2,easing:"easeIn"});this.statusBar.setText(this.showText)}this.form.getEl().un("click",this.hideErrors,this)},onStatusClick:function(){if(this.getMsgEl().isVisible()){this.hideErrors()}else{if(this.errors.getCount()>0){this.showErrors()}}}});(function(){Ext.override(Ext.list.Column,{init:function(){var b=Ext.data.Types,a=this.sortType;if(this.type){if(Ext.isString(this.type)){this.type=Ext.data.Types[this.type.toUpperCase()]||b.AUTO}}else{this.type=b.AUTO}if(Ext.isString(a)){this.sortType=Ext.data.SortTypes[a]}else{if(Ext.isEmpty(a)){this.sortType=this.type.sortType}}}});Ext.tree.Column=Ext.extend(Ext.list.Column,{});Ext.tree.NumberColumn=Ext.extend(Ext.list.NumberColumn,{});Ext.tree.DateColumn=Ext.extend(Ext.list.DateColumn,{});Ext.tree.BooleanColumn=Ext.extend(Ext.list.BooleanColumn,{});Ext.reg("tgcolumn",Ext.tree.Column);Ext.reg("tgnumbercolumn",Ext.tree.NumberColumn);Ext.reg("tgdatecolumn",Ext.tree.DateColumn);Ext.reg("tgbooleancolumn",Ext.tree.BooleanColumn)})();Ext.ux.tree.TreeGridNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:true,renderElements:function(d,l,h,m){var o=d.getOwnerTree(),k=o.columns,j=k[0],e,b,g;this.indentMarkup=d.parentNode?d.parentNode.ui.getChildIndent():"";b=['','','','',this.indentMarkup,"",'','','",'',(j.tpl?j.tpl.apply(l):l[j.dataIndex]||j.text),"",""];for(e=1,g=k.length;e','
    ",(j.tpl?j.tpl.apply(l):l[j.dataIndex]),"
    ","")}b.push('','');for(e=0,g=k.length;e')}b.push("");if(m!==true&&d.nextSibling&&d.nextSibling.ui.getEl()){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",d.nextSibling.ui.getEl(),b.join(""))}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",h,b.join(""))}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1].firstChild.firstChild;var f=this.elNode.firstChild.childNodes;this.indentNode=f[0];this.ecNode=f[1];this.iconNode=f[2];this.anchor=f[3];this.textNode=f[3].firstChild},animExpand:function(a){this.ctNode.style.display="";Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this,a)}});Ext.ux.tree.TreeGridRootNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:true,render:function(){if(!this.rendered){this.wrap=this.ctNode=this.node.ownerTree.innerCt.dom;this.node.expanded=true}if(Ext.isWebKit){var a=this.ctNode;a.style.tableLayout=null;(function(){a.style.tableLayout="fixed"}).defer(1)}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}delete this.node},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.ColumnResizer=Ext.extend(Ext.util.Observable,{minWidth:14,constructor:function(a){Ext.apply(this,a);Ext.tree.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.tree=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(f,k){var g=5,j=f.getPageX(),d=f.getTarget(".x-treegrid-hd",3,true);if(d){var b=d.getRegion(),l=d.dom.style,c=d.dom.parentNode;if(j-b.left<=g&&d.dom!==c.firstChild){var a=d.dom.previousSibling;while(a&&Ext.fly(a).hasClass("x-treegrid-hd-hidden")){a=a.previousSibling}if(a){this.activeHd=Ext.get(a);l.cursor=Ext.isWebKit?"e-resize":"col-resize"}}else{if(b.right-j<=g){var h=d.dom;while(h&&Ext.fly(h).hasClass("x-treegrid-hd-hidden")){h=h.previousSibling}if(h){this.activeHd=Ext.get(h);l.cursor=Ext.isWebKit?"w-resize":"col-resize"}}else{delete this.activeHd;l.cursor=""}}}},onBeforeStart:function(a){this.dragHd=this.activeHd;return !!this.dragHd},onStart:function(b){this.tree.headersDisabled=true;this.proxy=this.tree.body.createChild({cls:"x-treegrid-resizer"});this.proxy.setHeight(this.tree.body.getHeight());var a=this.tracker.getXY()[0];this.hdX=this.dragHd.getX();this.hdIndex=this.tree.findHeaderIndex(this.dragHd);this.proxy.setX(this.hdX);this.proxy.setWidth(a-this.hdX);this.maxWidth=this.tree.outerCt.getWidth()-this.tree.innerBody.translatePoints(this.hdX).left},onDrag:function(b){var a=this.tracker.getXY()[0];this.proxy.setWidth((a-this.hdX).constrain(this.minWidth,this.maxWidth))},onEnd:function(c){var b=this.proxy.getWidth(),a=this.tree;this.proxy.remove();delete this.dragHd;a.columns[this.hdIndex].width=b;a.updateColumnWidths();setTimeout(function(){a.headersDisabled=false},100)}});Ext.ns("Ext.ux.tree");Ext.ux.tree.TreeGridSorter=Ext.extend(Ext.tree.TreeSorter,{sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",constructor:function(a,b){if(!Ext.isObject(b)){b={property:a.columns[0].dataIndex||"text",folderSort:true}}Ext.ux.tree.TreeGridSorter.superclass.constructor.apply(this,arguments);this.tree=a;a.on("headerclick",this.onHeaderClick,this);a.ddAppendOnly=true;me=this;this.defaultSortFn=function(k,j){var f=me.dir&&me.dir.toLowerCase()=="desc";var c=me.property||"text";var e=me.sortType;var g=me.folderSort;var h=me.caseSensitive===true;var d=me.leafAttr||"leaf";if(g){if(k.attributes[d]&&!j.attributes[d]){return 1}if(!k.attributes[d]&&j.attributes[d]){return -1}}var m=e?e(k):(h?k.attributes[c]:k.attributes[c].toUpperCase());var l=e?e(j):(h?j.attributes[c]:j.attributes[c].toUpperCase());if(ml){return f?-1:+1}else{return 0}}};a.on("afterrender",this.onAfterTreeRender,this,{single:true});a.on("headermenuclick",this.onHeaderMenuClick,this)},onAfterTreeRender:function(){if(this.tree.hmenu){this.tree.hmenu.insert(0,{itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"})}this.updateSortIcon(0,"asc")},onHeaderMenuClick:function(d,b,a){if(b==="asc"||b==="desc"){this.onHeaderClick(d,null,a);return false}},onHeaderClick:function(e,b,a){if(e&&!this.tree.headersDisabled){var d=this;d.property=e.dataIndex;d.dir=e.dir=(e.dir==="desc"?"asc":"desc");d.sortType=e.sortType;d.caseSensitive===Ext.isBoolean(e.caseSensitive)?e.caseSensitive:this.caseSensitive;d.sortFn=e.sortFn||this.defaultSortFn;this.tree.root.cascade(function(c){if(!c.isLeaf()){d.updateSort(d.tree,c)}});this.updateSortIcon(a,e.dir)}},updateSortIcon:function(b,a){var d=this.sortClasses;var c=this.tree.innerHd.select("td").removeClass(d);c.item(b).addClass(d[a=="desc"?1:0])}});Ext.ux.tree.TreeGridLoader=Ext.extend(Ext.tree.TreeLoader,{createNode:function(a){if(!a.uiProvider){a.uiProvider=Ext.ux.tree.TreeGridNodeUI}return Ext.tree.TreeLoader.prototype.createNode.call(this,a)}});Ext.ux.tree.TreeGrid=Ext.extend(Ext.tree.TreePanel,{rootVisible:false,useArrows:true,lines:false,borderWidth:Ext.isBorderBox?0:2,cls:"x-treegrid",columnResize:true,enableSort:true,reserveScrollOffset:true,enableHdMenu:true,columnsText:"Columns",initComponent:function(){if(!this.root){this.root=new Ext.tree.AsyncTreeNode({text:"Root"})}var a=this.loader;if(!a){a=new Ext.ux.tree.TreeGridLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod,store:this.store})}else{if(Ext.isObject(a)&&!a.load){a=new Ext.ux.tree.TreeGridLoader(a)}else{if(a){a.createNode=function(c){if(!c.uiProvider){c.uiProvider=Ext.ux.tree.TreeGridNodeUI}return Ext.tree.TreeLoader.prototype.createNode.call(this,c)}}}}this.loader=a;Ext.ux.tree.TreeGrid.superclass.initComponent.call(this);this.initColumns();if(this.enableSort){this.treeGridSorter=new Ext.ux.tree.TreeGridSorter(this,this.enableSort)}if(this.columnResize){this.colResizer=new Ext.tree.ColumnResizer(this.columnResize);this.colResizer.init(this)}var b=this.columns;if(!this.internalTpl){this.internalTpl=new Ext.XTemplate('
    ','
    ','
    ','','','','","","
    ','
    ',this.enableHdMenu?'':"",'{header}',"
    ","
    ","
    ","
    ",'
    ','
    ',"
    ")}if(!this.colgroupTpl){this.colgroupTpl=new Ext.XTemplate('')}},initColumns:function(){var e=this.columns,a=e.length,d=[],b,f;for(b=0;b10)){this.setScrollOffset(a)}else{var d=this;setTimeout(function(){d.setScrollOffset(e.offsetWidth-e.clientWidth>10?a:0)},10)}}},updateColumnWidths:function(){var k=this.columns,m=k.length,a=this.outerCt.query("colgroup"),l=a.length,h,e,d,b;for(d=0;d0&&this.columns[a]){this.setColumnVisible(a,!b.checked)}}return true},setColumnVisible:function(a,b){this.columns[a].hidden=!b;this.updateColumnWidths()},scrollToTop:function(){this.innerBody.dom.scrollTop=0;this.innerBody.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.innerBody.dom;this.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerBody.dom;this.innerHd.dom.scrollLeft=a.scrollLeft;this.innerHd.dom.scrollLeft=a.scrollLeft},registerNode:function(a){Ext.ux.tree.TreeGrid.superclass.registerNode.call(this,a);if(!a.uiProvider&&!a.isRoot&&!a.ui.isTreeGridNodeUI){a.ui=new Ext.ux.tree.TreeGridNodeUI(a)}}});Ext.reg("treegrid",Ext.ux.tree.TreeGrid); \ No newline at end of file +Ext.ns("Ext.ux.grid");Ext.ux.grid.LockingGridView=Ext.extend(Ext.grid.GridView,{lockText:"Lock",unlockText:"Unlock",rowBorderWidth:1,lockedBorderWidth:1,syncHeights:false,initTemplates:function(){var a=this.templates||{};if(!a.masterTpl){a.masterTpl=new Ext.Template('
    ','
    ','
    {lockedHeader}
    ','
    {lockedBody}
    ',"
    ",'
    ','
    {header}
    ','
    {body}
    ',"
    ",'
     
    ','
     
    ',"
    ")}this.templates=a;Ext.ux.grid.LockingGridView.superclass.initTemplates.call(this)},getEditorParent:function(a){return this.el.dom},initElements:function(){var e=Ext.get(this.grid.getGridEl().dom.firstChild),g=e.child("div.x-grid3-locked"),c=g.child("div.x-grid3-header"),b=g.child("div.x-grid3-scroller"),f=e.child("div.x-grid3-viewport"),d=f.child("div.x-grid3-header"),a=f.child("div.x-grid3-scroller");if(this.grid.hideHeaders){c.setDisplayed(false);d.setDisplayed(false)}if(this.forceFit){a.setStyle("overflow-x","hidden")}Ext.apply(this,{el:e,mainWrap:f,mainHd:d,innerHd:d.dom.firstChild,scroller:a,mainBody:a.child("div.x-grid3-body"),focusEl:a.child("a"),resizeMarker:e.child("div.x-grid3-resize-marker"),resizeProxy:e.child("div.x-grid3-resize-proxy"),lockedWrap:g,lockedHd:c,lockedScroller:b,lockedBody:b.child("div.x-grid3-body"),lockedInnerHd:c.child("div.x-grid3-header-inner",true)});this.focusEl.swallowEvent("click",true)},getLockedRows:function(){return this.hasRows()?this.lockedBody.dom.childNodes:[]},getLockedRow:function(a){return this.getLockedRows()[a]},getCell:function(c,a){var b=this.cm.getLockedCount();if(aa){b.setHeight(c)}else{if(a>c){d.setHeight(a)}}}},afterRender:function(){if(!this.ds||!this.cm){return}var a=this.renderRows()||[" "," "];this.mainBody.dom.innerHTML=a[0];this.lockedBody.dom.innerHTML=a[1];this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}this.grid.fireEvent("viewready",this.grid)},renderUI:function(){var b=this.templates,c=this.renderHeaders(),a=b.body.apply({rows:" "});return b.masterTpl.apply({body:a,header:c[0],ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";",lockedBody:a,lockedHeader:c[1],lstyle:"width:"+this.getLockedWidth()+";"})},afterRenderUI:function(){var a=this.grid;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);Ext.fly(this.lockedInnerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.lockedHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(a.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(a,this.mainHd.dom);this.splitZone.setOuterHandleElId(Ext.id(this.lockedHd.dom));this.splitZone.setOuterHandleElId(Ext.id(this.mainHd.dom))}if(a.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(a,this.innerHd);this.columnDrag.setOuterHandleElId(Ext.id(this.lockedInnerHd));this.columnDrag.setOuterHandleElId(Ext.id(this.innerHd));this.columnDrop=new Ext.grid.HeaderDropZone(a,this.mainHd.dom)}if(a.enableHdMenu!==false){this.hmenu=new Ext.menu.Menu({id:a.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(this.grid.enableColLock!==false){this.hmenu.add("-",{itemId:"lock",text:this.lockText,cls:"xg-hmenu-lock"},{itemId:"unlock",text:this.unlockText,cls:"xg-hmenu-unlock"})}if(a.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:a.id+"-hcols-menu"});this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick});this.hmenu.add("-",{itemId:"columns",hideOnClick:false,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(a.trackMouseOver){this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut});this.lockedBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut})}if(a.enableDragDrop||a.enableDrag){this.dragZone=new Ext.grid.GridDragZone(a,{ddGroup:a.ddGroup||"GridDD"})}this.updateHeaderSortState()},layout:function(){if(!this.mainBody){return}var d=this.grid;var h=d.getGridEl();var a=h.getSize(true);var b=a.width;if(!d.hideHeaders&&(b<20||a.height<20)){return}this.syncHeaderHeight();if(d.autoHeight){this.scroller.dom.style.overflow="visible";this.lockedScroller.dom.style.overflow="visible";if(Ext.isWebKit){this.scroller.dom.style.position="static";this.lockedScroller.dom.style.position="static"}}else{this.el.setSize(a.width,a.height);var f=this.mainHd.getHeight();var e=a.height-(f)}this.updateLockedWidth();if(this.forceFit){if(this.lastViewWidth!=b){this.fitColumns(false,false);this.lastViewWidth=b}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(b,e)},getOffsetWidth:function(){return(this.cm.getTotalWidth()-this.cm.getTotalLockedWidth()+this.getScrollOffset())+"px"},renderHeaders:function(){var h=this.cm,f=this.templates,d=f.hcell,b=[],g=[],a={},e=h.getColumnCount(),j=e-1;for(var c=0;c=c){this.refresh()}else{if(!f){this.fireEvent("beforerowsinserted",this,g,d)}var b=this.renderRows(g,d),e=this.getRow(g);if(e){if(g===0){this.removeRowClass(0,this.firstRowCls)}Ext.DomHelper.insertHtml("beforeBegin",e,b[0]);e=this.getLockedRow(g);Ext.DomHelper.insertHtml("beforeBegin",e,b[1])}else{this.removeRowClass(c-1,this.lastRowCls);Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,b[0]);Ext.DomHelper.insertHtml("beforeEnd",this.lockedBody.dom,b[1])}if(!f){this.fireEvent("rowsinserted",this,g,d);this.processRows(g)}else{if(g===0||g>=c){this.addRowClass(g,g===0?this.firstRowCls:this.lastRowCls)}}}this.syncFocusEl(g)},getColumnStyle:function(a,c){var b=!c?this.cm.config[a].cellStyle||this.cm.config[a].css||"":this.cm.config[a].headerStyle||"";b+="width:"+this.getColumnWidth(a)+";";if(this.cm.isHidden(a)){b+="display:none;"}var d=this.cm.config[a].align;if(d){b+="text-align:"+d+";"}return b},getLockedWidth:function(){return this.cm.getTotalLockedWidth()+"px"},getTotalWidth:function(){return(this.cm.getTotalWidth()-this.cm.getTotalLockedWidth())+"px"},getColumnData:function(){var d=[],a=this.cm,e=a.getColumnCount();for(var c=0;cc&&!a&&b){this.setLocked(d,true,true)}}Ext.ux.grid.LockingColumnModel.superclass.moveColumn.apply(this,arguments)}});Ext.ns("Ext.ux.form");Ext.ux.form.MultiSelect=Ext.extend(Ext.form.Field,{ddReorder:false,appendOnly:false,width:100,height:100,displayField:0,valueField:1,allowBlank:true,minSelections:0,maxSelections:Number.MAX_VALUE,blankText:Ext.form.TextField.prototype.blankText,minSelectionsText:"Minimum {0} item(s) required",maxSelectionsText:"Maximum {0} item(s) allowed",delimiter:",",defaultAutoCreate:{tag:"div"},initComponent:function(){Ext.ux.form.MultiSelect.superclass.initComponent.call(this);if(Ext.isArray(this.store)){if(Ext.isArray(this.store[0])){this.store=new Ext.data.ArrayStore({fields:["value","text"],data:this.store});this.valueField="value"}else{this.store=new Ext.data.ArrayStore({fields:["text"],data:this.store,expandData:true});this.valueField="text"}this.displayField="text"}else{this.store=Ext.StoreMgr.lookup(this.store)}this.addEvents({dblclick:true,click:true,change:true,drop:true})},onRender:function(c,b){Ext.ux.form.MultiSelect.superclass.onRender.call(this,c,b);var a=this.fs=new Ext.form.FieldSet({renderTo:this.el,title:this.legend,height:this.height,width:this.width,style:"padding:0;",tbar:this.tbar});a.body.addClass("ux-mselect");this.view=new Ext.ListView({multiSelect:true,store:this.store,columns:[{header:"Value",width:1,dataIndex:this.displayField}],hideHeaders:true});a.add(this.view);this.view.on("click",this.onViewClick,this);this.view.on("beforeclick",this.onViewBeforeClick,this);this.view.on("dblclick",this.onViewDblClick,this);this.hiddenName=this.name||Ext.id();var d={tag:"input",type:"hidden",value:"",name:this.hiddenName};this.hiddenField=this.el.createChild(d);this.hiddenField.dom.disabled=this.hiddenName!=this.name;a.doLayout()},afterRender:function(){Ext.ux.form.MultiSelect.superclass.afterRender.call(this);if(this.ddReorder&&!this.dragGroup&&!this.dropGroup){this.dragGroup=this.dropGroup="MultiselectDD-"+Ext.id()}if(this.draggable||this.dragGroup){this.dragZone=new Ext.ux.form.MultiSelect.DragZone(this,{ddGroup:this.dragGroup})}if(this.droppable||this.dropGroup){this.dropZone=new Ext.ux.form.MultiSelect.DropZone(this,{ddGroup:this.dropGroup})}},onViewClick:function(c,a,b,d){this.fireEvent("change",this,this.getValue(),this.hiddenField.dom.value);this.hiddenField.dom.value=this.getValue();this.fireEvent("click",this,d);this.validate()},onViewBeforeClick:function(c,a,b,d){if(this.disabled||this.readOnly){return false}},onViewDblClick:function(c,a,b,d){return this.fireEvent("dblclick",c,a,b,d)},getValue:function(a){var d=[];var c=this.view.getSelectedIndexes();if(c.length==0){return""}for(var b=0;bthis.maxSelections){this.markInvalid(String.format(this.maxSelectionsText,this.maxSelections));return false}return true},disable:function(){this.disabled=true;this.hiddenField.dom.disabled=true;this.fs.disable()},enable:function(){this.disabled=false;this.hiddenField.dom.disabled=false;this.fs.enable()},destroy:function(){Ext.destroy(this.fs,this.dragZone,this.dropZone);Ext.ux.form.MultiSelect.superclass.destroy.call(this)}});Ext.reg("multiselect",Ext.ux.form.MultiSelect);Ext.ux.Multiselect=Ext.ux.form.MultiSelect;Ext.ux.form.MultiSelect.DragZone=function(d,c){this.ms=d;this.view=d.view;var b=c.ddGroup||"MultiselectDD";var a;if(Ext.isArray(b)){a=b.shift()}else{a=b;b=null}Ext.ux.form.MultiSelect.DragZone.superclass.constructor.call(this,this.ms.fs.body,{containerScroll:true,ddGroup:a});this.setDraggable(b)};Ext.extend(Ext.ux.form.MultiSelect.DragZone,Ext.dd.DragZone,{onInitDrag:function(a,c){var b=Ext.get(this.dragData.ddel.cloneNode(true));this.proxy.update(b.dom);b.setWidth(b.child("em").getWidth());this.onStartDrag(a,c);return true},collectSelection:function(b){b.repairXY=Ext.fly(this.view.getSelectedNodes()[0]).getXY();var a=0;this.view.store.each(function(d){if(this.view.isSelected(a)){var e=this.view.getNode(a);var c=e.cloneNode(true);c.id=Ext.id();b.ddel.appendChild(c);b.records.push(this.view.store.getAt(a));b.viewNodes.push(e)}a++},this)},onEndDrag:function(a,b){var c=Ext.get(this.dragData.ddel);if(c&&c.hasClass("multi-proxy")){c.remove()}},getDragData:function(d){var c=this.view.findItemFromChild(d.getTarget());if(c){if(!this.view.isSelected(c)&&!d.ctrlKey&&!d.shiftKey){this.view.select(c);this.ms.setValue(this.ms.getValue())}if(this.view.getSelectionCount()==0||d.ctrlKey||d.shiftKey){return false}var b={sourceView:this.view,viewNodes:[],records:[]};if(this.view.getSelectionCount()==1){var a=this.view.getSelectedIndexes()[0];var f=this.view.getNode(a);b.viewNodes.push(b.ddel=f);b.records.push(this.view.store.getAt(a));b.repairXY=Ext.fly(f).getXY()}else{b.ddel=document.createElement("div");b.ddel.className="multi-proxy";this.collectSelection(b)}return b}return false},getRepairXY:function(a){return this.dragData.repairXY},setDraggable:function(a){if(!a){return}if(Ext.isArray(a)){Ext.each(a,this.setDraggable,this);return}this.addToGroup(a)}});Ext.ux.form.MultiSelect.DropZone=function(d,c){this.ms=d;this.view=d.view;var b=c.ddGroup||"MultiselectDD";var a;if(Ext.isArray(b)){a=b.shift()}else{a=b;b=null}Ext.ux.form.MultiSelect.DropZone.superclass.constructor.call(this,this.ms.fs.body,{containerScroll:true,ddGroup:a});this.setDroppable(b)};Ext.extend(Ext.ux.form.MultiSelect.DropZone,Ext.dd.DropZone,{getTargetFromEvent:function(b){var a=b.getTarget();return a},getDropPoint:function(g,k,d){if(k==this.ms.fs.body.dom){return"below"}var f=Ext.lib.Dom.getY(k),a=f+k.offsetHeight;var j=f+(a-f)/2;var h=Ext.lib.Event.getPageY(g);if(h<=j){return"above"}else{return"below"}},isValidDropPoint:function(b,e,a){if(!a.viewNodes||(a.viewNodes.length!=1)){return true}var c=a.viewNodes[0];if(c==e){return false}if((b=="below")&&(e.nextSibling==c)){return false}if((b=="above")&&(e.previousSibling==c)){return false}return true},onNodeEnter:function(d,a,c,b){return false},onNodeOver:function(h,a,g,d){var b=this.dropNotAllowed;var f=this.getDropPoint(g,h,a);if(this.isValidDropPoint(f,h,d)){if(this.ms.appendOnly){return"x-tree-drop-ok-below"}if(f){var c;if(f=="above"){b=h.previousSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-above";c="x-view-drag-insert-above"}else{b=h.nextSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-below";c="x-view-drag-insert-below"}if(this.lastInsertClass!=c){Ext.fly(h).replaceClass(this.lastInsertClass,c);this.lastInsertClass=c}}}return b},onNodeOut:function(d,a,c,b){this.removeDropIndicators(d)},onNodeDrop:function(b,j,h,f){if(this.ms.fireEvent("drop",this,b,j,h,f)===false){return false}var k=this.getDropPoint(h,b,j);if(b!=this.ms.fs.body.dom){b=this.view.findItemFromChild(b)}if(this.ms.appendOnly){insertAt=this.view.store.getCount()}else{insertAt=b==this.ms.fs.body.dom?this.view.store.getCount()-1:this.view.indexOf(b);if(k=="below"){insertAt++}}var c=false;if(f.sourceView==this.view){if(k=="below"){if(f.viewNodes[0]==b){f.viewNodes.shift()}}else{if(f.viewNodes[f.viewNodes.length-1]==b){f.viewNodes.pop()}}if(!f.viewNodes.length){return false}if(insertAt>this.view.store.indexOf(f.records[0])){c="down";insertAt--}}for(var g=0;ge?1:(nf[1]){l=true;break}}}j=(l&&r?j:v.items.getCount())+(k?-1:0);var g=this.createEvent(w,u,x,d,v,j);if(a.fireEvent("validatedrop",g)!==false&&a.fireEvent("beforedragover",g)!==false){o.getProxy().setWidth("auto");if(r){o.moveProxy(r.el.dom.parentNode,l?r.el.dom:null)}else{o.moveProxy(v.el.dom,null)}this.lastPos={c:v,col:d,p:k||(l&&r)?j:false};this.scrollPos=a.body.getScroll();a.fireEvent("dragover",g);return g.status}else{return g.status}},notifyOut:function(){delete this.grid},notifyDrop:function(m,h,g){delete this.grid;if(!this.lastPos){return}var k=this.lastPos.c,f=this.lastPos.col,l=this.lastPos.p,a=m.panel,b=this.createEvent(m,h,g,f,k,l!==false?l:k.items.getCount());if(this.portal.fireEvent("validatedrop",b)!==false&&this.portal.fireEvent("beforedrop",b)!==false){m.proxy.getProxy().remove();a.el.dom.parentNode.removeChild(m.panel.el.dom);if(l!==false){k.insert(l,a)}else{k.add(a)}k.doLayout();this.portal.fireEvent("drop",b);var n=this.scrollPos.top;if(n){var j=this.portal.body.dom;setTimeout(function(){j.scrollTop=n},10)}}delete this.lastPos},getGrid:function(){var a=this.portal.bwrap.getBox();a.columnX=[];this.portal.items.each(function(b){a.columnX.push({x:b.el.getX(),w:b.el.getWidth()})});return a},unreg:function(){Ext.dd.ScrollManager.unregister(this.portal.body);Ext.ux.Portal.DropZone.superclass.unreg.call(this)}});Ext.ux.PortalColumn=Ext.extend(Ext.Container,{layout:"anchor",defaultType:"portlet",cls:"x-portal-column"});Ext.reg("portalcolumn",Ext.ux.PortalColumn);Ext.ux.Portlet=Ext.extend(Ext.Panel,{anchor:"100%",frame:true,collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("portlet",Ext.ux.Portlet);Ext.ux.ProgressBarPager=Ext.extend(Object,{progBarWidth:225,defaultText:"Loading...",defaultAnimCfg:{duration:1,easing:"bounceOut"},constructor:function(a){if(a){Ext.apply(this,a)}},init:function(a){if(a.displayInfo){this.parent=a;var b=a.items.indexOf(a.displayItem);a.remove(a.displayItem,true);this.progressBar=new Ext.ProgressBar({text:this.defaultText,width:this.progBarWidth,animate:this.defaultAnimCfg});a.displayItem=this.progressBar;a.add(a.displayItem);a.doLayout();Ext.apply(a,this.parentOverrides);this.progressBar.on("render",function(c){c.mon(c.getEl().applyStyles("cursor:pointer"),"click",this.handleProgressBarClick,this)},this,{single:true})}},handleProgressBarClick:function(j){var d=this.parent,c=d.displayItem,f=this.progressBar.getBox(),h=j.getXY(),b=h[0]-f.x,a=Math.ceil(d.store.getTotalCount()/d.pageSize),g=Math.ceil(b/(c.width/a));d.changePage(g)},parentOverrides:{updateInfo:function(){if(this.displayItem){var b=this.store.getCount(),a=this.getPageData(),d=this.readPage(a),e=b==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+b,this.store.getTotalCount());d=a.activePage;var c=d/a.pages;this.displayItem.updateProgress(c,e,this.animate||this.defaultAnimConfig)}}}});Ext.preg("progressbarpager",Ext.ux.ProgressBarPager);Ext.ns("Ext.ux.grid");Ext.ux.grid.RowEditor=Ext.extend(Ext.Panel,{floating:true,shadow:false,layout:"hbox",cls:"x-small-editor",buttonAlign:"center",baseCls:"x-row-editor",elements:"header,footer,body",frameWidth:5,buttonPad:3,clicksToEdit:"auto",monitorValid:true,focusDelay:250,errorSummary:true,saveText:"Save",cancelText:"Cancel",commitChangesText:"You need to commit or cancel your changes",errorText:"Errors",defaults:{normalWidth:true},initComponent:function(){Ext.ux.grid.RowEditor.superclass.initComponent.call(this);this.addEvents("beforeedit","canceledit","validateedit","afteredit")},init:function(a){this.grid=a;this.ownerCt=a;if(this.clicksToEdit===2){a.on("rowdblclick",this.onRowDblClick,this)}else{a.on("rowclick",this.onRowClick,this);if(Ext.isIE){a.on("rowdblclick",this.onRowDblClick,this)}}a.getStore().on("remove",function(){this.stopEditing(false)},this);a.on({scope:this,keydown:this.onGridKey,columnresize:this.verifyLayout,columnmove:this.refreshFields,reconfigure:this.refreshFields,beforedestroy:this.beforedestroy,destroy:this.destroy,bodyscroll:{buffer:250,fn:this.positionButtons}});a.getColumnModel().on("hiddenchange",this.verifyLayout,this,{delay:1});a.getView().on("refresh",this.stopEditing.createDelegate(this,[]))},beforedestroy:function(){this.stopMonitoring();this.grid.getStore().un("remove",this.onStoreRemove,this);this.stopEditing(false);Ext.destroy(this.btns,this.tooltip)},refreshFields:function(){this.initFields();this.verifyLayout()},isDirty:function(){var a;this.items.each(function(b){if(String(this.values[b.id])!==String(b.getValue())){a=true;return false}},this);return a},startEditing:function(k,p){if(this.editing&&this.isDirty()){this.showTooltip(this.commitChangesText);return}if(Ext.isObject(k)){k=this.grid.getStore().indexOf(k)}if(this.fireEvent("beforeedit",this,k)!==false){this.editing=true;var e=this.grid,l=e.getView(),o=l.getRow(k),c=e.store.getAt(k);this.record=c;this.rowIndex=k;this.values={};if(!this.rendered){this.render(l.getEditorParent())}var m=Ext.fly(o).getWidth();this.setSize(m);if(!this.initialized){this.initFields()}var n=e.getColumnModel(),d=this.items.items,j,a;for(var b=0,h=n.getColumnCount();b=h){d=b;break}}}return d},startMonitoring:function(){if(!this.bound&&this.monitorValid){this.bound=true;Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){this.bound=false;if(this.tooltip){this.tooltip.hide()}},isValid:function(){var a=true;this.items.each(function(b){if(!b.isValid(true)){a=false;return false}});return a},bindHandler:function(){if(!this.bound){return false}var a=this.isValid();if(!a&&this.errorSummary){this.showTooltip(this.getErrorText().join(""))}this.btns.saveBtn.setDisabled(!a);this.fireEvent("validation",this,a)},lastVisibleColumn:function(){var a=this.items.getCount()-1,b;for(;a>=0;a--){b=this.items.items[a];if(!b.hidden){return b}}},showTooltip:function(f){var c=this.tooltip;if(!c){c=this.tooltip=new Ext.ToolTip({maxWidth:600,cls:"errorTip",width:300,title:this.errorText,autoHide:false,anchor:"left",anchorToTarget:true,mouseOffset:[40,0]})}var b=this.grid.getView(),e=parseInt(this.el.dom.style.top,10),a=b.scroller.dom.scrollTop,d=this.el.getHeight();if(e+d>=a){c.initTarget(this.lastVisibleColumn().getEl());if(!c.rendered){c.show();c.hide()}c.body.update(f);c.doAutoWidth(20);c.show()}else{if(c.rendered){c.hide()}}},getErrorText:function(){var a=["
      "];this.items.each(function(b){if(!b.isValid(true)){a.push("
    • ",b.getActiveError(),"
    • ")}});a.push("
    ");return a}});Ext.preg("roweditor",Ext.ux.grid.RowEditor);Ext.ns("Ext.ux.grid");Ext.ux.grid.RowExpander=Ext.extend(Ext.util.Observable,{expandOnEnter:true,expandOnDblClick:true,header:"",width:20,sortable:false,fixed:true,hideable:false,menuDisabled:true,dataIndex:"",id:"expander",lazyRender:true,enableCaching:true,constructor:function(a){Ext.apply(this,a);this.addEvents({beforeexpand:true,expand:true,beforecollapse:true,collapse:true});Ext.ux.grid.RowExpander.superclass.constructor.call(this);if(this.tpl){if(typeof this.tpl=="string"){this.tpl=new Ext.Template(this.tpl)}this.tpl.compile()}this.state={};this.bodyContent={}},getRowClass:function(a,e,d,c){d.cols=d.cols-1;var b=this.bodyContent[a.id];if(!b&&!this.lazyRender){b=this.getBodyContent(a,e)}if(b){d.body=b}return this.state[a.id]?"x-grid3-row-expanded":"x-grid3-row-collapsed"},init:function(b){this.grid=b;var a=b.getView();a.getRowClass=this.getRowClass.createDelegate(this);a.enableRowBody=true;b.on("render",this.onRender,this);b.on("destroy",this.onDestroy,this)},onRender:function(){var a=this.grid;var b=a.getView().mainBody;b.on("mousedown",this.onMouseDown,this,{delegate:".x-grid3-row-expander"});if(this.expandOnEnter){this.keyNav=new Ext.KeyNav(this.grid.getGridEl(),{enter:this.onEnter,scope:this})}if(this.expandOnDblClick){a.on("rowdblclick",this.onRowDblClick,this)}},onDestroy:function(){if(this.keyNav){this.keyNav.disable();delete this.keyNav}var a=this.grid.getView().mainBody;if(a){a.un("mousedown",this.onMouseDown,this)}},onRowDblClick:function(a,b,c){this.toggleRow(b)},onEnter:function(h){var f=this.grid;var j=f.getSelectionModel();var b=j.getSelections();for(var c=0,a=b.length;c '},beforeExpand:function(b,a,c){if(this.fireEvent("beforeexpand",this,b,a,c)!==false){if(this.tpl&&this.lazyRender){a.innerHTML=this.getBodyContent(b,c)}return true}else{return false}},toggleRow:function(a){if(typeof a=="number"){a=this.grid.view.getRow(a)}this[Ext.fly(a).hasClass("x-grid3-row-collapsed")?"expandRow":"collapseRow"](a)},expandRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c)}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.DomQuery.selectNode("tr:nth(2) div.x-grid3-row-body",c);if(this.beforeExpand(b,a,c.rowIndex)){this.state[b.id]=true;Ext.fly(c).replaceClass("x-grid3-row-collapsed","x-grid3-row-expanded");this.fireEvent("expand",this,b,a,c.rowIndex)}},collapseRow:function(c){if(typeof c=="number"){c=this.grid.view.getRow(c)}var b=this.grid.store.getAt(c.rowIndex);var a=Ext.fly(c).child("tr:nth(1) div.x-grid3-row-body",true);if(this.fireEvent("beforecollapse",this,b,a,c.rowIndex)!==false){this.state[b.id]=false;Ext.fly(c).replaceClass("x-grid3-row-expanded","x-grid3-row-collapsed");this.fireEvent("collapse",this,b,a,c.rowIndex)}}});Ext.preg("rowexpander",Ext.ux.grid.RowExpander);Ext.grid.RowExpander=Ext.ux.grid.RowExpander;Ext.ns("Ext.ux.layout");Ext.ux.layout.RowLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,type:"row",allowContainerRemove:false,isValidParent:function(b,a){return this.innerCt&&b.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var b=this.container.getLayoutTarget(),a;if(b){a=b.getViewSize();if(Ext.isIE&&Ext.isStrict&&a.height==0){a=b.getStyleSize()}a.width-=b.getPadding("lr");a.height-=b.getPadding("tb")}return a},renderAll:function(a,b){if(!this.innerCt){this.innerCt=b.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(g,k){var c=g.items.items,j=c.length,a,b,d,n=[];this.renderAll(g,k);var o=this.getLayoutTargetSize();if(o.width<1&&o.height<1){return}var e=o.height,f=e;this.innerCt.setSize({height:e});for(d=0;d{0} of {1}",d.value,d.slider.maxValue)}}),listeners:{changecomplete:function(e,d){b.changePage(d)}}});b.insert(a+1,c);b.on({change:function(d,e){c.setMaxValue(e.pages);c.setValue(e.activePage)}})}});Ext.ns("Ext.ux.form");Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:"wrap",deferHeight:true,autoSize:Ext.emptyFn,onBlur:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(c){var b=Ext.copyTo({},c,"incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass");var d=this.spinner=new Ext.ux.Spinner(b);var a=c.plugins?(Ext.isArray(c.plugins)?c.plugins.push(d):[c.plugins,d]):d;Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(c,{plugins:a}))},getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},validateBlur:function(){return true}});Ext.reg("spinnerfield",Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,defaultValue:0,accelerate:false,constructor:function(a){Ext.ux.Spinner.superclass.constructor.call(this,a);Ext.apply(this,a);this.mimicing=false},init:function(a){this.field=a;a.afterMethod("onRender",this.doRender,this);a.afterMethod("onEnable",this.doEnable,this);a.afterMethod("onDisable",this.doDisable,this);a.afterMethod("afterRender",this.doAfterRender,this);a.afterMethod("onResize",this.doResize,this);a.afterMethod("onFocus",this.doFocus,this);a.beforeMethod("onDestroy",this.doDestroy,this)},doRender:function(b,a){var c=this.el=this.field.getEl();var d=this.field;if(!d.wrap){d.wrap=this.wrap=c.wrap({cls:"x-form-field-wrap"})}else{this.wrap=d.wrap.addClass("x-form-field-wrap")}this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(!d.width){this.wrap.setWidth(c.getWidth()+this.trigger.getWidth())}this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});this.splitter.setRight((Ext.isIE)?1:2).setTop(10).show();this.proxy=this.trigger.createProxy("",this.splitter,true);this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle("left","0px");this.proxy.setSize(14,1);this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});this.initTrigger();this.initSpinner()},doAfterRender:function(){var a;if(Ext.isIE&&this.el.getY()!=(a=this.trigger.getY())){this.el.position();this.el.setY(a)}},doEnable:function(){if(this.wrap){this.wrap.removeClass(this.field.disabledClass)}},doDisable:function(){if(this.wrap){this.wrap.addClass(this.field.disabledClass);this.el.removeClass(this.field.disabledClass)}},doResize:function(a,b){if(typeof a=="number"){this.el.setWidth(a-this.trigger.getWidth())}this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},doFocus:function(){if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});this.el.on("keydown",this.checkTab,this)}},checkTab:function(a){if(a.getKey()==a.TAB){this.triggerBlur()}},mimicBlur:function(a){if(!this.wrap.contains(a.target)&&this.field.validateBlur(a)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab,this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");this.field.onBlur.call(this.field)},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){this.field.addEvents({spin:true,spinup:true,spindown:true});this.keyNav=new Ext.KeyNav(this.el,{up:function(a){a.preventDefault();this.onSpinUp()},down:function(a){a.preventDefault();this.onSpinDown()},pageUp:function(a){a.preventDefault();this.onSpinUpAlternate()},pageDown:function(a){a.preventDefault();this.onSpinDownAlternate()},scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:true});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:true});this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this);this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);this.dd.onDrag=this.onDrag.createDelegate(this)},onMouseOver:function(){if(this.disabled){return}var a=this.getMiddle();this.tmpHoverClass=(Ext.EventObject.getPageY()a)&&this.tmpHoverClass=="x-form-spinner-overup")||((Ext.EventObject.getPageY()0){this.onSpinUp();a.stopEvent()}else{if(b<0){this.onSpinDown();a.stopEvent()}}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop()},endDrag:function(){this.proxy.hide()},onDrag:function(){if(this.disabled){return}var b=Ext.fly(this.dd.getDragEl()).getTop();var a="";if(this._previousY>b){a="Up"}if(this._previousYthis.field.maxValue){a=this.field.maxValue}return this.fixPrecision(a)},fixPrecision:function(b){var a=isNaN(b);if(!this.field.allowDecimals||this.field.decimalPrecision==-1||a||!b){return a?"":b}return parseFloat(parseFloat(b).toFixed(this.field.decimalPrecision))},doDestroy:function(){if(this.trigger){this.trigger.remove()}if(this.wrap){this.wrap.remove();delete this.field.wrap}if(this.splitter){this.splitter.remove()}if(this.dd){this.dd.unreg();this.dd=null}if(this.proxy){this.proxy.remove()}if(this.repeater){this.repeater.purgeListeners()}if(this.mimicing){Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this)}}});Ext.form.Spinner=Ext.ux.Spinner;Ext.ux.Spotlight=function(a){Ext.apply(this,a)};Ext.ux.Spotlight.prototype={active:false,animate:true,duration:0.25,easing:"easeNone",animated:false,createElements:function(){var a=Ext.getBody();this.right=a.createChild({cls:"x-spotlight"});this.left=a.createChild({cls:"x-spotlight"});this.top=a.createChild({cls:"x-spotlight"});this.bottom=a.createChild({cls:"x-spotlight"});this.all=new Ext.CompositeElement([this.right,this.left,this.top,this.bottom])},show:function(b,c,a){if(this.animated){this.show.defer(50,this,[b,c,a]);return}this.el=Ext.get(b);if(!this.right){this.createElements()}if(!this.active){this.all.setDisplayed("");this.applyBounds(true,false);this.active=true;Ext.EventManager.onWindowResize(this.syncSize,this);this.applyBounds(false,this.animate,false,c,a)}else{this.applyBounds(false,false,false,c,a)}},hide:function(b,a){if(this.animated){this.hide.defer(50,this,[b,a]);return}Ext.EventManager.removeResizeListener(this.syncSize,this);this.applyBounds(true,this.animate,true,b,a)},doHide:function(){this.active=false;this.all.setDisplayed(false)},syncSize:function(){this.applyBounds(false,false)},applyBounds:function(e,d,k,j,l){var h=this.el.getRegion();var a=Ext.lib.Dom.getViewWidth(true);var g=Ext.lib.Dom.getViewHeight(true);var f=0,b=false;if(d){b={callback:function(){f++;if(f==4){this.animated=false;if(k){this.doHide()}Ext.callback(j,l,[this])}},scope:this,duration:this.duration,easing:this.easing};this.animated=true}this.right.setBounds(h.right,e?g:h.top,a-h.right,e?0:(g-h.top),b);this.left.setBounds(0,0,h.left,e?0:h.bottom,b);this.top.setBounds(e?a:h.left,0,e?0:a-h.left,h.top,b);this.bottom.setBounds(0,h.bottom,e?0:h.right,g-h.bottom,b);if(!d){if(k){this.doHide()}if(j){Ext.callback(j,l,[this])}}},destroy:function(){this.doHide();Ext.destroy(this.right,this.left,this.top,this.bottom);delete this.el;delete this.all}};Ext.Spotlight=Ext.ux.Spotlight;Ext.ux.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5000,emptyText:" ",activeThreadId:0,initComponent:function(){if(this.statusAlign=="right"){this.cls+=" x-status-right"}Ext.ux.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.ux.StatusBar.superclass.afterRender.call(this);var a=this.statusAlign=="right";this.currIconCls=this.iconCls||this.defaultIconCls;this.statusEl=new Ext.Toolbar.TextItem({cls:"x-status-text "+(this.currIconCls||""),text:this.text||this.defaultText||""});if(a){this.add("->");this.add(this.statusEl)}else{this.insert(0,this.statusEl);this.insert(1,"->")}this.doLayout()},setStatus:function(d){d=d||{};if(typeof d=="string"){d={text:d}}if(d.text!==undefined){this.setText(d.text)}if(d.iconCls!==undefined){this.setIcon(d.iconCls)}if(d.clear){var e=d.clear,b=this.autoClear,a={useDefaults:true,anim:true};if(typeof e=="object"){e=Ext.applyIf(e,a);if(e.wait){b=e.wait}}else{if(typeof e=="number"){b=e;e=a}else{if(typeof e=="boolean"){e=a}}}e.threadId=this.activeThreadId;this.clearStatus.defer(b,this,[e])}return this},clearStatus:function(c){c=c||{};if(c.threadId&&c.threadId!==this.activeThreadId){return this}var b=c.useDefaults?this.defaultText:this.emptyText,a=c.useDefaults?(this.defaultIconCls?this.defaultIconCls:""):"";if(c.anim){this.statusEl.el.fadeOut({remove:false,useDisplay:true,scope:this,callback:function(){this.setStatus({text:b,iconCls:a});this.statusEl.el.show()}})}else{this.statusEl.hide();this.setStatus({text:b,iconCls:a});this.statusEl.show()}return this},setText:function(a){this.activeThreadId++;this.text=a||"";if(this.rendered){this.statusEl.setText(this.text)}return this},getText:function(){return this.text},setIcon:function(a){this.activeThreadId++;a=a||"";if(this.rendered){if(this.currIconCls){this.statusEl.removeClass(this.currIconCls);this.currIconCls=null}if(a.length>0){this.statusEl.addClass(a);this.currIconCls=a}}else{this.currIconCls=a}return this},showBusy:function(a){if(typeof a=="string"){a={text:a}}a=Ext.applyIf(a||{},{text:this.busyText,iconCls:this.busyIconCls});return this.setStatus(a)}});Ext.reg("statusbar",Ext.ux.StatusBar);Ext.ux.TabCloseMenu=Ext.extend(Object,{closeTabText:"Close Tab",closeOtherTabsText:"Close Other Tabs",showCloseAll:true,closeAllTabsText:"Close All Tabs",constructor:function(a){Ext.apply(this,a||{})},init:function(a){this.tabs=a;a.on({scope:this,contextmenu:this.onContextMenu,destroy:this.destroy})},destroy:function(){Ext.destroy(this.menu);delete this.menu;delete this.tabs;delete this.active},onContextMenu:function(b,c,g){this.active=c;var a=this.createMenu(),d=true,h=true,f=a.getComponent("closeall");a.getComponent("close").setDisabled(!c.closable);b.items.each(function(){if(this.closable){d=false;if(this!=c){h=false;return false}}});a.getComponent("closeothers").setDisabled(h);if(f){f.setDisabled(d)}g.stopEvent();a.showAt(g.getPoint())},createMenu:function(){if(!this.menu){var a=[{itemId:"close",text:this.closeTabText,scope:this,handler:this.onClose}];if(this.showCloseAll){a.push("-")}a.push({itemId:"closeothers",text:this.closeOtherTabsText,scope:this,handler:this.onCloseOthers});if(this.showCloseAll){a.push({itemId:"closeall",text:this.closeAllTabsText,scope:this,handler:this.onCloseAll})}this.menu=new Ext.menu.Menu({items:a})}return this.menu},onClose:function(){this.tabs.remove(this.active)},onCloseOthers:function(){this.doClose(true)},onCloseAll:function(){this.doClose(false)},doClose:function(b){var a=[];this.tabs.items.each(function(c){if(c.closable){if(!b||c!=this.active){a.push(c)}}},this);Ext.each(a,function(c){this.tabs.remove(c)},this)}});Ext.preg("tabclosemenu",Ext.ux.TabCloseMenu);Ext.ns("Ext.ux.grid");Ext.ux.grid.TableGrid=function(p,f){f=f||{};Ext.apply(this,f);var c=f.fields||[],a=f.columns||[];p=Ext.get(p);var k=p.insertSibling();var l=[],m=[];var e=p.query("thead th");for(var g=0,j;j=e[g];g++){var o=j.innerHTML;var b="tcol-"+g;l.push(Ext.applyIf(c[g]||{},{name:b,mapping:"td:nth("+(g+1)+")/@innerHTML"}));m.push(Ext.applyIf(a[g]||{},{header:o,dataIndex:b,width:j.offsetWidth,tooltip:j.title,sortable:true}))}var d=new Ext.data.Store({reader:new Ext.data.XmlReader({record:"tbody tr"},l)});d.loadData(p.dom);var n=new Ext.grid.ColumnModel(m);if(f.width||f.height){k.setSize(f.width||"auto",f.height||"auto")}else{k.setWidth(p.getWidth())}if(f.remove!==false){p.remove()}Ext.applyIf(this,{ds:d,cm:n,sm:new Ext.grid.RowSelectionModel(),autoHeight:true,autoWidth:false});Ext.ux.grid.TableGrid.superclass.constructor.call(this,k,{})};Ext.extend(Ext.ux.grid.TableGrid,Ext.grid.GridPanel);Ext.grid.TableGrid=Ext.ux.grid.TableGrid;Ext.ns("Ext.ux");Ext.ux.TabScrollerMenu=Ext.extend(Object,{pageSize:10,maxText:15,menuPrefixText:"Items",constructor:function(a){a=a||{};Ext.apply(this,a)},init:function(b){Ext.apply(b,this.parentOverrides);b.tabScrollerMenu=this;var a=this;b.on({render:{scope:b,single:true,fn:function(){var c=b.createScrollers.createSequence(a.createPanelsMenu,this);b.createScrollers=c}}})},createPanelsMenu:function(){var c=this.stripWrap.dom.offsetHeight;var b=this.header.dom.firstChild;Ext.fly(b).applyStyles({right:"18px"});var a=Ext.get(this.strip.dom.parentNode);a.applyStyles({"margin-right":"36px"});var d=this.header.insertFirst({cls:"x-tab-tabmenu-right"});d.setHeight(c);d.addClassOnOver("x-tab-tabmenu-over");d.on("click",this.showTabsMenu,this);this.scrollLeft.show=this.scrollLeft.show.createSequence(function(){d.show()});this.scrollLeft.hide=this.scrollLeft.hide.createSequence(function(){d.hide()})},getPageSize:function(){return this.pageSize},setPageSize:function(a){this.pageSize=a},getMaxText:function(){return this.maxText},setMaxText:function(a){this.maxText=a},getMenuPrefixText:function(){return this.menuPrefixText},setMenuPrefixText:function(a){this.menuPrefixText=a},parentOverrides:{showTabsMenu:function(c){if(this.tabsMenu){this.tabsMenu.destroy();this.un("destroy",this.tabsMenu.destroy,this.tabsMenu);this.tabsMenu=null}this.tabsMenu=new Ext.menu.Menu();this.on("destroy",this.tabsMenu.destroy,this.tabsMenu);this.generateTabMenuItems();var b=Ext.get(c.getTarget());var a=b.getXY();a[1]+=24;this.tabsMenu.showAt(a)},generateTabMenuItems:function(){var a=this.getActiveTab();var l=this.items.getCount();var g=this.tabScrollerMenu.getPageSize();if(l>g){var d=Math.floor(l/g);var j=l%g;for(var e=0;e0){var c=d*g;b=[];for(var e=c;e0){var e=this.parseXml(f);if(typeof e=="string"){c.attributes.innerText=e}else{c.appendChild(e)}}a.push(c)}else{if(f.nodeType==this.XML_NODE_TEXT){var d=f.nodeValue.trim();if(d.length>0){return a=d}}}},this);return a},createNode:function(b){var a={tagName:b.tagName};Ext.each(b.attributes,function(c){a[c.nodeName]=c.nodeValue});this.processAttributes(a);return Ext.ux.tree.XmlTreeLoader.superclass.createNode.call(this,a)},processAttributes:Ext.emptyFn});Ext.ux.XmlTreeLoader=Ext.ux.tree.XmlTreeLoader;Ext.ux.ValidationStatus=Ext.extend(Ext.Component,{errorIconCls:"x-status-error",errorListCls:"x-status-error-list",validIconCls:"x-status-valid",showText:"The form has errors (click for details...)",hideText:"Click again to hide the error list",submitText:"Saving...",init:function(a){a.on("render",function(){this.statusBar=a;this.monitor=true;this.errors=new Ext.util.MixedCollection();this.listAlign=(a.statusAlign=="right"?"br-tr?":"bl-tl?");if(this.form){this.form=Ext.getCmp(this.form).getForm();this.startMonitoring();this.form.on("beforeaction",function(d,c){if(c.type=="submit"){this.monitor=false}},this);var b=function(){this.monitor=true};this.form.on("actioncomplete",b,this);this.form.on("actionfailed",b,this)}},this,{single:true});a.on({scope:this,afterlayout:{single:true,fn:function(){a.statusEl.getEl().on("click",this.onStatusClick,this,{buffer:200})}},beforedestroy:{single:true,fn:this.onDestroy}})},startMonitoring:function(){this.form.items.each(function(a){a.on("invalid",this.onFieldValidation,this);a.on("valid",this.onFieldValidation,this)},this)},stopMonitoring:function(){this.form.items.each(function(a){a.un("invalid",this.onFieldValidation,this);a.un("valid",this.onFieldValidation,this)},this)},onDestroy:function(){this.stopMonitoring();this.statusBar.statusEl.un("click",this.onStatusClick,this);Ext.ux.ValidationStatus.superclass.onDestroy.call(this)},onFieldValidation:function(a,b){if(!this.monitor){return false}if(b){this.errors.add(a.id,{field:a,msg:b})}else{this.errors.removeKey(a.id)}this.updateErrorList();if(this.errors.getCount()>0){if(this.statusBar.getText()!=this.showText){this.statusBar.setStatus({text:this.showText,iconCls:this.errorIconCls})}}else{this.statusBar.clearStatus().setIcon(this.validIconCls)}},updateErrorList:function(){if(this.errors.getCount()>0){var a="
      ";this.errors.each(function(b){a+=('
    • '+b.msg+"
    • ")},this);this.getMsgEl().update(a+"
    ")}else{this.getMsgEl().update("")}},getMsgEl:function(){if(!this.msgEl){this.msgEl=Ext.DomHelper.append(Ext.getBody(),{cls:this.errorListCls+" x-hide-offsets"},true);this.msgEl.on("click",function(b){var a=b.getTarget("li",10,true);if(a){Ext.getCmp(a.id.split("x-err-")[1]).focus();this.hideErrors()}},this,{stopEvent:true})}return this.msgEl},showErrors:function(){this.updateErrorList();this.getMsgEl().alignTo(this.statusBar.getEl(),this.listAlign).slideIn("b",{duration:0.3,easing:"easeOut"});this.statusBar.setText(this.hideText);this.form.getEl().on("click",this.hideErrors,this,{single:true})},hideErrors:function(){var a=this.getMsgEl();if(a.isVisible()){a.slideOut("b",{duration:0.2,easing:"easeIn"});this.statusBar.setText(this.showText)}this.form.getEl().un("click",this.hideErrors,this)},onStatusClick:function(){if(this.getMsgEl().isVisible()){this.hideErrors()}else{if(this.errors.getCount()>0){this.showErrors()}}}});(function(){Ext.override(Ext.list.Column,{init:function(){var b=Ext.data.Types,a=this.sortType;if(this.type){if(Ext.isString(this.type)){this.type=Ext.data.Types[this.type.toUpperCase()]||b.AUTO}}else{this.type=b.AUTO}if(Ext.isString(a)){this.sortType=Ext.data.SortTypes[a]}else{if(Ext.isEmpty(a)){this.sortType=this.type.sortType}}}});Ext.tree.Column=Ext.extend(Ext.list.Column,{});Ext.tree.NumberColumn=Ext.extend(Ext.list.NumberColumn,{});Ext.tree.DateColumn=Ext.extend(Ext.list.DateColumn,{});Ext.tree.BooleanColumn=Ext.extend(Ext.list.BooleanColumn,{});Ext.reg("tgcolumn",Ext.tree.Column);Ext.reg("tgnumbercolumn",Ext.tree.NumberColumn);Ext.reg("tgdatecolumn",Ext.tree.DateColumn);Ext.reg("tgbooleancolumn",Ext.tree.BooleanColumn)})();Ext.ux.tree.TreeGridNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:true,renderElements:function(d,l,h,m){var o=d.getOwnerTree(),k=o.columns,j=k[0],e,b,g;this.indentMarkup=d.parentNode?d.parentNode.ui.getChildIndent():"";b=['','','','',this.indentMarkup,"",'','','",'',(j.tpl?j.tpl.apply(l):l[j.dataIndex]||j.text),"",""];for(e=1,g=k.length;e','
    ",(j.tpl?j.tpl.apply(l):l[j.dataIndex]),"
    ","")}b.push('','');for(e=0,g=k.length;e')}b.push("");if(m!==true&&d.nextSibling&&d.nextSibling.ui.getEl()){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",d.nextSibling.ui.getEl(),b.join(""))}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",h,b.join(""))}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1].firstChild.firstChild;var f=this.elNode.firstChild.childNodes;this.indentNode=f[0];this.ecNode=f[1];this.iconNode=f[2];this.anchor=f[3];this.textNode=f[3].firstChild},animExpand:function(a){this.ctNode.style.display="";Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this,a)}});Ext.ux.tree.TreeGridRootNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:true,render:function(){if(!this.rendered){this.wrap=this.ctNode=this.node.ownerTree.innerCt.dom;this.node.expanded=true}if(Ext.isWebKit){var a=this.ctNode;a.style.tableLayout=null;(function(){a.style.tableLayout="fixed"}).defer(1)}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}delete this.node},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.ColumnResizer=Ext.extend(Ext.util.Observable,{minWidth:14,constructor:function(a){Ext.apply(this,a);Ext.tree.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.tree=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(f,k){var g=5,j=f.getPageX(),d=f.getTarget(".x-treegrid-hd",3,true);if(d){var b=d.getRegion(),l=d.dom.style,c=d.dom.parentNode;if(j-b.left<=g&&d.dom!==c.firstChild){var a=d.dom.previousSibling;while(a&&Ext.fly(a).hasClass("x-treegrid-hd-hidden")){a=a.previousSibling}if(a){this.activeHd=Ext.get(a);l.cursor=Ext.isWebKit?"e-resize":"col-resize"}}else{if(b.right-j<=g){var h=d.dom;while(h&&Ext.fly(h).hasClass("x-treegrid-hd-hidden")){h=h.previousSibling}if(h){this.activeHd=Ext.get(h);l.cursor=Ext.isWebKit?"w-resize":"col-resize"}}else{delete this.activeHd;l.cursor=""}}}},onBeforeStart:function(a){this.dragHd=this.activeHd;return !!this.dragHd},onStart:function(b){this.dragHeadersDisabled=this.tree.headersDisabled;this.tree.headersDisabled=true;this.proxy=this.tree.body.createChild({cls:"x-treegrid-resizer"});this.proxy.setHeight(this.tree.body.getHeight());var a=this.tracker.getXY()[0];this.hdX=this.dragHd.getX();this.hdIndex=this.tree.findHeaderIndex(this.dragHd);this.proxy.setX(this.hdX);this.proxy.setWidth(a-this.hdX);this.maxWidth=this.tree.outerCt.getWidth()-this.tree.innerBody.translatePoints(this.hdX).left},onDrag:function(b){var a=this.tracker.getXY()[0];this.proxy.setWidth((a-this.hdX).constrain(this.minWidth,this.maxWidth))},onEnd:function(d){var b=this.proxy.getWidth(),a=this.tree,c=this.dragHeadersDisabled;this.proxy.remove();delete this.dragHd;a.columns[this.hdIndex].width=b;a.updateColumnWidths();setTimeout(function(){a.headersDisabled=c},100)}});Ext.ns("Ext.ux.tree");Ext.ux.tree.TreeGridSorter=Ext.extend(Ext.tree.TreeSorter,{sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",constructor:function(a,b){if(!Ext.isObject(b)){b={property:a.columns[0].dataIndex||"text",folderSort:true}}Ext.ux.tree.TreeGridSorter.superclass.constructor.apply(this,arguments);this.tree=a;a.on("headerclick",this.onHeaderClick,this);a.ddAppendOnly=true;var c=this;this.defaultSortFn=function(l,k){var j=c.dir&&c.dir.toLowerCase()=="desc",d=c.property||"text",f=c.sortType,n=c.caseSensitive===true,e=c.leafAttr||"leaf",o=l.attributes,m=k.attributes;if(c.folderSort){if(o[e]&&!m[e]){return 1}if(!o[e]&&m[e]){return -1}}var h=o[d],g=m[d],p=f?f(h):(n?h:h.toUpperCase());v2=f?f(g):(n?g:g.toUpperCase());if(pv2){return j?-1:+1}else{return 0}}};a.on("afterrender",this.onAfterTreeRender,this,{single:true});a.on("headermenuclick",this.onHeaderMenuClick,this)},onAfterTreeRender:function(){if(this.tree.hmenu){this.tree.hmenu.insert(0,{itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"})}this.updateSortIcon(0,"asc")},onHeaderMenuClick:function(d,b,a){if(b==="asc"||b==="desc"){this.onHeaderClick(d,null,a);return false}},onHeaderClick:function(e,b,a){if(e&&!this.tree.headersDisabled){var d=this;d.property=e.dataIndex;d.dir=e.dir=(e.dir==="desc"?"asc":"desc");d.sortType=e.sortType;d.caseSensitive===Ext.isBoolean(e.caseSensitive)?e.caseSensitive:this.caseSensitive;d.sortFn=e.sortFn||this.defaultSortFn;this.tree.root.cascade(function(c){if(!c.isLeaf()){d.updateSort(d.tree,c)}});this.updateSortIcon(a,e.dir)}},updateSortIcon:function(b,a){var d=this.sortClasses,c=this.tree.innerHd.select("td").removeClass(d);c.item(b).addClass(d[a=="desc"?1:0])}});Ext.ux.tree.TreeGridLoader=Ext.extend(Ext.tree.TreeLoader,{createNode:function(a){if(!a.uiProvider){a.uiProvider=Ext.ux.tree.TreeGridNodeUI}return Ext.tree.TreeLoader.prototype.createNode.call(this,a)}});Ext.ux.tree.TreeGrid=Ext.extend(Ext.tree.TreePanel,{rootVisible:false,useArrows:true,lines:false,borderWidth:Ext.isBorderBox?0:2,cls:"x-treegrid",columnResize:true,enableSort:true,reserveScrollOffset:true,enableHdMenu:true,columnsText:"Columns",initComponent:function(){if(!this.root){this.root=new Ext.tree.AsyncTreeNode({text:"Root"})}var a=this.loader;if(!a){a=new Ext.ux.tree.TreeGridLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod,store:this.store})}else{if(Ext.isObject(a)&&!a.load){a=new Ext.ux.tree.TreeGridLoader(a)}}this.loader=a;Ext.ux.tree.TreeGrid.superclass.initComponent.call(this);this.initColumns();if(this.enableSort){this.treeGridSorter=new Ext.ux.tree.TreeGridSorter(this,this.enableSort)}if(this.columnResize){this.colResizer=new Ext.tree.ColumnResizer(this.columnResize);this.colResizer.init(this)}var b=this.columns;if(!this.internalTpl){this.internalTpl=new Ext.XTemplate('
    ','
    ','
    ','','','','","","
    ','
    ',this.enableHdMenu?'':"",'{header}',"
    ","
    ","
    ","
    ",'
    ','
    ',"
    ")}if(!this.colgroupTpl){this.colgroupTpl=new Ext.XTemplate('')}},initColumns:function(){var e=this.columns,a=e.length,d=[],b,f;for(b=0;b10)){this.setScrollOffset(a)}else{var d=this;setTimeout(function(){d.setScrollOffset(e.offsetWidth-e.clientWidth>10?a:0)},10)}}},updateColumnWidths:function(){var k=this.columns,m=k.length,a=this.outerCt.query("colgroup"),l=a.length,h,e,d,b;for(d=0;d0&&this.columns[a]){this.setColumnVisible(a,!b.checked)}}return true},setColumnVisible:function(a,b){this.columns[a].hidden=!b;this.updateColumnWidths()},scrollToTop:function(){this.innerBody.dom.scrollTop=0;this.innerBody.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.innerBody.dom;this.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerBody.dom;this.innerHd.dom.scrollLeft=a.scrollLeft;this.innerHd.dom.scrollLeft=a.scrollLeft},registerNode:function(a){Ext.ux.tree.TreeGrid.superclass.registerNode.call(this,a);if(!a.uiProvider&&!a.isRoot&&!a.ui.isTreeGridNodeUI){a.ui=new Ext.ux.tree.TreeGridNodeUI(a)}}});Ext.reg("treegrid",Ext.ux.tree.TreeGrid); \ No newline at end of file