datatables icon indicating copy to clipboard operation
datatables copied to clipboard

[datatables] how do I have two global search filter?

Open 0x00000000000000000000000 opened this issue 1 year ago • 3 comments

Original: image

How do I have two global search filter, for eg image

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)>

vincjo avatar Sep 16 '24 12:09 vincjo

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

vincjo avatar Sep 18 '24 11:09 vincjo