File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export interface TableFilterConfig {
7
7
fn ?: TableFilterFn ;
8
8
initialFilterValue ?: string ;
9
9
includeHiddenColumns ?: boolean ;
10
+ serverSide ?: boolean ;
10
11
}
11
12
12
13
export interface TableFilterState < Item > {
@@ -106,6 +107,7 @@ export const addTableFilter =
106
107
fn = textPrefixFilter ,
107
108
initialFilterValue = '' ,
108
109
includeHiddenColumns = false ,
110
+ serverSide = false ,
109
111
} : TableFilterConfig = { } ) : TablePlugin <
110
112
Item ,
111
113
TableFilterState < Item > ,
@@ -115,7 +117,7 @@ export const addTableFilter =
115
117
( { columnOptions } ) => {
116
118
const filterValue = writable ( initialFilterValue ) ;
117
119
const preFilteredRows = writable < BodyRow < Item > [ ] > ( [ ] ) ;
118
- const filteredRows = writable < BodyRow < Item > [ ] > ( [ ] ) ;
120
+ // const filteredRows = writable<BodyRow<Item>[]>([]);
119
121
const tableCellMatches = recordSetStore ( ) ;
120
122
121
123
const pluginState : TableFilterState < Item > = { filterValue, preFilteredRows } ;
@@ -131,8 +133,12 @@ export const addTableFilter =
131
133
includeHiddenColumns,
132
134
} ) ;
133
135
tableCellMatches . set ( $tableCellMatches ) ;
134
- filteredRows . set ( $filteredRows ) ;
135
- return $filteredRows ;
136
+ //filteredRows.set($filteredRows);
137
+ if ( serverSide ) {
138
+ return $rows ;
139
+ } else {
140
+ return $filteredRows ;
141
+ }
136
142
} ) ;
137
143
} ;
138
144
You can’t perform that action at this time.
0 commit comments