akveo / akveo/ng2-smart-table

Dropdown filter with a textbox than each column filter

Aperta
#926 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
1.6k
Fork
867
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Is it possible for each column filter to be combined into a dropdown select and a textbox?

So far from I see such as in issue [1827](https://github.com/akveo/ngx-admin/issues/1827#issue-351913374)
```

settings: {
columns: {
age: {
title: 'Age',
editor: {
type: 'list',
config: {
selectText: 'Select',
list: [
{value: '1', title:'Option 1'},
{value: '2', title:'Option 2'},
{value: '3', title:'Option 3'},
{value: '4', title:'Option 4'},
],
},
}
filter: {
type: 'list',
config: {
selectText: 'Select',
list: [
{value: '1', title:'Option 1'},
{value: '2', title:'Option 2'},
{value: '3', title:'Option 3'},
{value: '4', title:'Option 4'},
],
},
},
},
}
}
```
The filter would search for each column. But is it possible to combine all filter into a select and by then
got filtered by the textbox? Example:
![image](https://user-images.githubusercontent.com/17746819/50763333-181bfc80-12a2-11e9-92b9-0740b1e426a3.png)

Update:
For more clarification, I do manage to get the value from the custom dropdown into the textbox. But, problem is `setFilter` such as in [example](https://akveo.github.io/ng2-smart-table/#/examples/using-filters):

```
onSearch(query: string = '') {
this.source.setFilter([
// fields we want to include in the search
{
field: 'id',
search: query
},
{
field: 'name',
search: query
},
{
field: 'username',
search: query
},
{
field: 'email',
search: query
}
], false);
// second parameter specifying whether to perform 'AND' or 'OR' search
// (meaning all columns should contain search query or at least one)
// 'AND' by default, so changing to 'OR' by setting false here
}
```
was unable to be customized to only filter a field depending on selected value.

I've tried to use
```
{
field: value,
search: query
}
```
where value is the selected value but no avail.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.