添加 remoteFilter方法,支持用户远程筛选数据

This commit is contained in:
H 2017-04-06 17:07:03 +08:00
parent 15b72d31b0
commit 12bcf7bd14
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.currentContext,column._filterChecked,column.key,column);
}
this.cloneColumns.forEach((col, colIndex) => {
if (colIndex !== index) {
data = this.filterData(data, col);