Merge pull request #605 from hezhiying/table-filters

添加filterRemote方法,支持用户远程筛选数据
This commit is contained in:
Aresn 2017-04-22 14:14:01 +08:00 committed by GitHub
commit 91bda66d87
2 changed files with 47 additions and 1 deletions

View file

@ -496,6 +496,9 @@
},
filterData (data, column) {
return data.filter((row) => {
if(typeof column.filterRemote == 'function'){ //
return true;
}
let status = !column._filterChecked.length;
for (let i = 0; i < column._filterChecked.length; i++) {
status = column.filterMethod(column._filterChecked[i], row);
@ -505,6 +508,11 @@
});
},
filterOtherData (data, index) {
let column = this.cloneColumns[index];
if(typeof column.filterRemote == 'function'){
column.filterRemote.call(this.$parent,column._filterChecked,column.key,column);
}
this.cloneColumns.forEach((col, colIndex) => {
if (colIndex !== index) {
data = this.filterData(data, col);