添加 remoteFilter方法,支持用户远程筛选数据
This commit is contained in:
parent
15b72d31b0
commit
12bcf7bd14
2 changed files with 47 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue