vuejs-datatable icon indicating copy to clipboard operation
vuejs-datatable copied to clipboard

'Filterable' column option doesn't limit filterable fields

Open notthatnathan opened this issue 4 years ago • 3 comments

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

notthatnathan avatar Feb 29 '20 18:02 notthatnathan

I'll confirm this is an issue, i can filter by any column even though most columns have filterable: false

codemonkey76 avatar Jul 16 '20 03:07 codemonkey76

Thanks for the feedback! I'll try to look at this asap. PR welcome if you want and are faster than me ;)

GerkinDev avatar Jul 19 '20 21:07 GerkinDev

I'm not smart enough, lol

codemonkey76 avatar Jul 24 '20 07:07 codemonkey76