File tree 3 files changed +23
-2
lines changed
components/PaginatedTable
3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ enum FilterType {
2
2
text = 'text' ,
3
3
date = 'date' ,
4
4
number = 'number' ,
5
- association = 'association '
5
+ tags = 'tags '
6
6
}
7
7
8
8
export default FilterType ;
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ export default class PageHooks {
5
5
private readonly _items_callback : Function ;
6
6
private readonly _count_callback : Function ;
7
7
8
+ private lastPage : number = 1 ;
9
+ private lastField : SortableField | null ;
10
+ private lastFilters : Array < FilterWithValue > | null ;
11
+
8
12
constructor ( items_callback : Function , count_callback : Function = null ) {
9
13
this . _items_callback = items_callback ;
10
14
this . _count_callback = count_callback || null ;
@@ -14,11 +18,18 @@ export default class PageHooks {
14
18
return this . _count_callback !== null ;
15
19
}
16
20
21
+ public refresh ( ) {
22
+ this . callForItems ( this . lastPage , this . lastField , this . lastFilters ) ;
23
+ }
24
+
17
25
public callForItems (
18
26
page : number ,
19
27
field : SortableField | null ,
20
28
filters : Array < FilterWithValue > | null
21
29
) : void {
30
+ this . lastPage = page ;
31
+ this . lastField = field ;
32
+ this . lastFilters = filters ;
22
33
this . _items_callback ( page , field , filters ) ;
23
34
}
24
35
Original file line number Diff line number Diff line change 119
119
/>
120
120
</div >
121
121
</div >
122
+ {:else if filter .type === FilterType .tags }
123
+ <input
124
+ id ="input_filter_ {filter .name }"
125
+ class =" form-control"
126
+ type =" text"
127
+ on:change ={onChange }
128
+ bind:value
129
+ />
122
130
{:else }
123
- <div class ="badge" >Unknown input type "{filter .type }"</div >
131
+ <h5 >
132
+ <span class ="badge bg-danger" >Unknown input type "{filter .type }"</span >
133
+ </h5 >
124
134
{/if }
125
135
</div >
126
136
</div >
You can’t perform that action at this time.
0 commit comments