Permalink
Browse files

feat: 当在多选的时候,设置selectChangeDatatable为true时,选中一个数据就会动态的去改变datatable

  • Loading branch information...
HuYuee committed Jun 30, 2017
1 parent 9d3eff7 commit 5e8464a52d4f3a91be76d0f93f6fc9fc108f792a
Showing with 19 additions and 1 deletion.
  1. +10 −1 lib/neoui-combo.js
  2. +9 −0 src/neoui-combo.js
View
@@ -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 = [];
@@ -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;
View
@@ -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;
@@ -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;

0 comments on commit 5e8464a

Please sign in to comment.