| 1 |
- MWF.xApplication.Selector=MWF.xApplication.Selector||{};MWF.xDesktop.requireApp("Selector","Person",null,false);MWF.xApplication.Selector.Application=new Class({Extends:MWF.xApplication.Selector.Person,options:{style:"default",count:0,title:MWF.xApplication.Selector.LP.selectApplication,values:[],expand:false},loadSelectItems:function(t){this.processAction.listApplications(function(t){debugger;t.data.each(function(t){var e=this._newItem(t,this,this.itemAreaNode)}.bind(this))}.bind(this))},_scrollEvent:function(t){return true},_getChildrenItemIds:function(){return null},_listItemByKey:function(t,e,i){return false},_getItem:function(t,e,i,n){this.processAction.getApplications(function(e){if(t)t.apply(this,[e])}.bind(this),e,typeOf(i)==="string"?i:i.id,n)},_newItemSelected:function(t,e,i){return new MWF.xApplication.Selector.Application.ItemSelected(t,e,i)},_listItemByPinyin:function(t,e,i){return false},_newItem:function(t,e,i,n){return new MWF.xApplication.Selector.Application.Item(t,e,i,n)}});MWF.xApplication.Selector.Application.Item=new Class({Extends:MWF.xApplication.Selector.Person.Item,_getShowName:function(){return this.data.name},_setIcon:function(){this.iconNode.setStyle("background-image","url("+"/x_component_Selector/$Selector/default/icon/applicationicon.png)")},loadSubItem:function(){return false},checkSelectedSingle:function(){var t=this.selector.options.values.filter(function(t,e){if(typeOf(t)==="object")return this.data.id===t.id||this.data.name===t.name;if(typeOf(t)==="string")return this.data.id===t||this.data.name===t;return false}.bind(this));if(t.length){this.selectedSingle()}},checkSelected:function(){var t=this.selector.selectedItems.filter(function(t,e){return t.data.id===this.data.id||t.data.name===this.data.name}.bind(this));if(t.length){t[0].addItem(this);this.selectedItem=t[0];this.setSelected()}}});MWF.xApplication.Selector.Application.ItemSelected=new Class({Extends:MWF.xApplication.Selector.Person.ItemSelected,_getShowName:function(){return this.data.name},_setIcon:function(){this.iconNode.setStyle("background-image","url("+"/x_component_Selector/$Selector/default/icon/applicationicon.png)")},check:function(){if(this.selector.items.length){var t=this.selector.items.filter(function(t,e){return t.data.id===this.data.id||t.data.name===this.data.name}.bind(this));this.items=t;if(t.length){t.each(function(t){t.selectedItem=this;t.setSelected()}.bind(this))}}}});
|