datatables
datatables copied to clipboard
[datatables] how do I have two global search filter?
Original:
How do I have two global search filter, for eg
search is a global statement in the DataHandler instance.
If you need an other global search, you can use handler.createFilter() or handler.filter() applied to all columns:
<script>
export let handler
let value = ''
const filter = handler.createFilter((row) => row)
</script>
<input type="text" bind:value on:input={() => filter.set(value)>
shortcut:
<script>
export let handler
let value = ''
</script>
<input type="text" bind:value on:input={() => handler.filter(value, (row) => row)>
Yes, but what happens if both filters have a search value ? It seems that only the second one would work.
I don't get exactly what you want to achieve