table of q-selects - how to filter
-
I have a q-table and each row has a q-select. I want to have autocomplete, but unable to pass the row index to the filter function.
The q-select includes this prop:
@filter="filterFn(props.row.rowIndex)
and the filter method looks like this:
filterFn (val, update, abort, rowIndex) { if (this.tableRows[rowIndex].itemList.length <= 0 || !val || val.length < 2) { abort() return } update(() => { const needle = val.toLowerCase() this.options = this.tableRows[rowIndex].itemList.filter(v => v.toLowerCase().indexOf(needle) > -1) }) },
But the rowIndex parameter is not getting passed.
-
@CWoodman said in table of q-selects - how to filter:
@filter
you can use function currying:
@filter="(val, update, abort) => filterFn(val, update, abort, props.row.rowIndex)"
-
Great! thanks.