提交 383788b4 编写于 作者: U unknown

选择人员的数据

上级 63bb813d
......@@ -252,7 +252,7 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/"+style+"/icon/companyicon.png)");
},
_addSelectedCount : function(){
this.selectedCountNode.set("text", this._getSelectedCount());
this.selectedCountNode.set("text", this._getSelectedCount() || "");
},
_getSelectedCount : function(){
var list = this.subItems.filter( function (item) { return item.isSelected; });
......@@ -266,6 +266,9 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
},
loadSub : function(callback){
this._loadSub( function() {
if( this.selector.options.showSelectedCount ){
this.selectedCountNode.set("text", this._getSelectedCount() || "" )
}
if( this.selector.options.isCheckStatus ){
}
......
......@@ -422,11 +422,38 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
_getShowName: function(){
return this.data.name;
},
_getSelectedCount : function(){
_addSelectedCount : function( count, nested ){
debugger;
var c;
if( typeOf( this.selectedCount ) === "number" ){
c = this.selectedCount + count;
}else{
c = this._getSelectedCount(nested, true);
}
this.selectedCount = c;
this.selectedCountNode.set("text", c || "");
if( nested && this.category && this.category._addSelectedCount ){
this.category._addSelectedCount(count, nested);
}
},
// _getSelectedCount : function(){
// var list = this.subItems.filter( function (item) { return item.isSelected; });
// return list.length;
// },
_getSelectedCount : function(nested, cache){
debugger;
if( typeOf( this.selectedCount ) === "number" ){
return this.selectedCount;
}else{
return 0
var count = 0;
if( nested ){
this.subCategorys.each( function (category) {
count = count + category._getSelectedCount( nested, cache );
});
}
var list = this.subItems.filter( function (item) { return item.isSelected; });
if( cache ) this.selectedCount = count+list.length;
return count+list.length;
}
},
_getNestItemCount : function(){
......@@ -490,6 +517,11 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit.ItemCategory = new Cla
}
this.loaded = true;
if( this.selector.options.showSelectedCount ){
this.selectedCountNode.set("text", this._getSelectedCount( true, true ) || "" )
}
if (callback) callback( );
}else{
if (callback) callback( );
......
......@@ -2448,12 +2448,9 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
this.textNode.setStyle("margin-left", ""+m+"px");
if( this.selector.options.showSelectedCount && this.selector.selectType == "identity" && this._getSelectedCount ){
var selectedCount = this._getSelectedCount();
if( selectedCount > 0 ){
this.selectedCountNode = new Element("span", {
"text": this._getSelectedCount()
}).inject(this.textNode);
}
this.selectedCountNode = new Element("span", {
"text": this._getSelectedCount() || ""
}).inject(this.textNode);
}
this.children = new Element("div.children", {
......@@ -2510,7 +2507,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
debugger;
var c = ( this._getSelectedCount() || 0 ) + count;
this.selectedCount = c;
this.selectedCountNode.set("text", c);
this.selectedCountNode.set("text", c || "");
if( nested && this.category && this.category._addSelectedCount ){
this.category._addSelectedCount(count, nested);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册