Skip to content

Commit

Permalink
feat: 当在多选的时候,设置selectChangeDatatable为true时,选中一个数据就会动态的去改变datatable
Browse files Browse the repository at this point in the history
  • Loading branch information
HuYuee committed Jun 30, 2017
1 parent 9d3eff7 commit 5e8464a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/neoui-combo.js
Expand Up @@ -17,8 +17,10 @@ var Combo = u.BaseComponent.extend({
if (hasClass(this.element, 'mutil-select')) {
this.mutilSelect = true;
}

//onlySelect=true,可以设置单选下拉框为readonly
this.onlySelect = this.options['onlySelect'] || false;
//当在多选的时候,设置selectChangeDatatable为true时,选中一个数据就会动态的去改变datatable
this.selectChangeDatatable = this.options['selectChangeDatatable'] || false;
if (this.mutilSelect) this.onlySelect = true;

this.comboDatas = [];
Expand Down Expand Up @@ -406,6 +408,13 @@ var Combo = u.BaseComponent.extend({
removeClass(lis[i], 'is-selected');
}
}
//选中一个数据就会动态的去改变datatable
if (this.selectChangeDatatable) {
this.trigger('select', {
value: this.value,
name: this.name
});
}
/*根据多选区域div的高度调整input的高度*/
/*实际上input的高度并不需要调整*/
/*var h = this._combo_name_par.offsetHeight;
Expand Down
9 changes: 9 additions & 0 deletions src/neoui-combo.js
Expand Up @@ -38,6 +38,8 @@ var Combo = u.BaseComponent.extend({
}
//onlySelect=true,可以设置单选下拉框为readonly
this.onlySelect = this.options['onlySelect'] || false;
//当在多选的时候,设置selectChangeDatatable为true时,选中一个数据就会动态的去改变datatable
this.selectChangeDatatable = this.options['selectChangeDatatable'] || false;
if (this.mutilSelect)
this.onlySelect = true;

Expand Down Expand Up @@ -437,6 +439,13 @@ var Combo = u.BaseComponent.extend({
removeClass(lis[i], 'is-selected');
}
}
//选中一个数据就会动态的去改变datatable
if(this.selectChangeDatatable){
this.trigger('select', {
value: this.value,
name: this.name
});
}
/*根据多选区域div的高度调整input的高度*/
/*实际上input的高度并不需要调整*/
/*var h = this._combo_name_par.offsetHeight;
Expand Down

0 comments on commit 5e8464a

Please sign in to comment.