提交 67378f7f 编写于 作者: U unknown

unselectAll

上级 97158f99
......@@ -696,6 +696,12 @@ MWF.xApplication.Selector.Identity.Item = new Class({
selectedItem[0].addItem(this);
this.selectedItem = selectedItem[0];
this.setSelected();
var flag = this.selector.options.selectAllRange === "all" ||
( this.selector.selectType == "identity" && ( this.selector.options.showSelectedCount || this.selector.options.isCheckStatus ));
if( flag ){
if(this.category && this.category._addSelectedCount )this.category._addSelectedCount( 1, true );
}
}
}
});
......@@ -782,7 +788,9 @@ MWF.xApplication.Selector.Identity.ItemSelected = new Class({
items.each(function(item){
item.selectedItem = this;
item.setSelected();
if( this.selector.selectType == "identity" && ( this.selector.options.showSelectedCount || this.selector.options.isCheckStatus ) ){
var flag = this.selector.options.selectAllRange === "all" ||
( this.selector.selectType == "identity" && ( this.selector.options.showSelectedCount || this.selector.options.isCheckStatus ) );
if( flag ){
if(item.category && item.category._addSelectedCount )item.category._addSelectedCount( 1, true );
}
}.bind(this));
......@@ -831,7 +839,17 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({
}
this.selectAllNode.setStyles( styles );
}
}else if( count === 0 && this.selector.options.selectAllRange === "all" && this.selectAllNode ){
styles = this.selector.css.selectorItemCategoryActionNode_selectAll;
this.isSelectedSome = false;
this.isSelectedAll = false;
this.selectAllNode.setStyles( styles );
}
if( !this.selectedCountNode1 ){
this.selectedCountNode1 = new Element("span").inject(this.textNode);
}
this.selectedCountNode1.set("text",count);
},
_getShowName: function(){
// if( this._getTotalCount && this._getSelectedCount ){
......
......@@ -1963,6 +1963,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
});
},
clickItem: function( callback, checkValid ){
debugger;
// if ( layout.mobile && this.selector.options.count.toInt()===1){
// this.selectedSingle( checkValid );
// }else{
......@@ -2089,6 +2090,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
}
},
unSelected: function( checkValid, callback ){
var isSelected = this.isSelected;
this.isSelected = false;
if( this.node ){
this.node.setStyles(this.selector.css.selectorItem);
......@@ -2102,7 +2104,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
}
}
if( this.category ){
if( this.category && this.selector.options.selectAllRange !== "all" ){
this.category.checkUnselectAll();
}
......@@ -2131,10 +2133,20 @@ MWF.xApplication.Selector.Person.Item = new Class({
}.bind(this))
}
debugger;
if (this.selectedItem){
this.selector.selectedItems.erase(this.selectedItem);
this.selectedItem.items.each(function(item){
if( item.isSelected || ( item === this && isSelected ) ){
var flag = this.selector.options.selectAllRange === "all" ||
( this.selector.selectType == "identity" && ( this.selector.options.showSelectedCount || this.selector.options.isCheckStatus ));
if( flag ){
if(item.category && item.category._addSelectedCount )item.category._addSelectedCount( -1, true );
}
}
if (item != this){
item.isSelected = false;
item.node.setStyles(this.selector.css.selectorItem);
......@@ -2147,9 +2159,6 @@ MWF.xApplication.Selector.Person.Item = new Class({
item.actionNode.setStyles( this.selector.css.selectorItemActionNode_single );
}
}
if( this.selector.selectType == "identity" && ( this.selector.options.showSelectedCount || this.selector.options.isCheckStatus ) ){
if(item.category && item.category._addSelectedCount )item.category._addSelectedCount( -1, true );
}
}.bind(this));
this.selectedItem.destroy();
......
......@@ -204,6 +204,8 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({
( this.data.woSubDirectUnitList || [] ).each(function(subData){
if( !this.selector.isExcluded( subData ) ) {
if ((!this.selector.options.unitType) || subData.typeList.indexOf(this.selector.options.unitType) !== -1) {
debugger;
var unit = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this);
this.selector.items.push( unit );
if( !this.subItems )this.subItems = [];
......@@ -257,6 +259,8 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({
this.data.woSubDirectUnitList.each(function(subData){
if( !this.selector.isExcluded( subData ) ) {
if ((!this.selector.options.unitType) || subData.typeList.indexOf(this.selector.options.unitType) !== -1) {
debugger;
var unit = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this, true);
unit.justItem = true;
unit.load();
......@@ -314,6 +318,8 @@ MWF.xApplication.Selector.UnitWithType.ItemCategory = new Class({
this.data.woSubDirectUnitList.each(function(subData){
if( !this.selector.isExcluded( subData ) ) {
if ((!this.selector.options.unitType) || subData.typeList.indexOf(this.selector.options.unitType)!==-1){
debugger;
var unit = this.selector._newItem(subData, this.selector, this.children, this.level+1, this);
if(this.subItems)this.subItems.push( unit );
}else{
......@@ -391,6 +397,8 @@ MWF.xApplication.Selector.UnitWithType.ItemCategory = new Class({
this.data.woSubDirectUnitList.each(function(subData){
if( !this.selector.isExcluded( subData ) ) {
if ((!this.selector.options.unitType) || subData.typeList.indexOf(this.selector.options.unitType)!==-1){
debugger;
var unit = this.selector._newItem(subData, this.selector, this.children, this.level+1, this);
if(this.subItems)this.subItems.push( unit );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册