vuejs-datatable
vuejs-datatable copied to clipboard
'Filterable' column option doesn't limit filterable fields
Tested in v.2.0.0-alpha.6 and 2.0.0-alpha.7
Expected one of these scenarios to work:
First scenario
- Desired filterable fields with
filterable: true
- Expected: Only fields with this prop would be filterable
- Actual: All fields are filterable
Second scenario
- Fields not to be filtered with
filterable: false
- Expected: All other fields are filterable, but not these
- Actual: They're still filterable
Example
<input v-model="filter" />
<datatable :filter="filter" />
export default {
data() {
return {
filter: ''
}
}
}
// columns
[
{
label: 'test',
field: 'test',
filterable: true,
},
{
label: 'test2',
field: 'test2',
filterable: false,
},
{
label: 'test2',
field: 'test3',
},
]
Expected: Entering test
returns either the first or the first and last option
Actual: Entering test
returns all three
I'll confirm this is an issue, i can filter by any column even though most columns have filterable: false
Thanks for the feedback! I'll try to look at this asap. PR welcome if you want and are faster than me ;)
I'm not smart enough, lol