create filter query for Tabulator with operators

45 Views Asked by At

I am searching for an usefriendly secure solution to filter a Tabulator datatable by query with operators, brackets for different data types (String, Date, Number)

at the momemt with the setFilter function and a custom filter function only normal String compare works

but it is not my prefered way to write "code" in my query

so for example instead of this

strComp(data.col1,'ba*') || strComp(data.col1,'he*')

moment(data.col3,"DD/MM/YYYY") >= moment("10/7/2023","DD/MM/YYYY")

that should work

data.col1 == 'ba*' ||  data.col1 == 'he*'

data.col3 >= "10/7/2023"

here I have tried some other ways for the solution jsfiddle

so, is there something in Tabulator or other apis to convert it or must I implement all by myself?

thx

Update, 2023-11-27
I found now this library https://github.com/AlaSQL/alasql
so I could so query row by row

slow and dirty solution, but so it is enough for me
https://jsfiddle.net/tripower/t2k7cpLn/50/

0

There are 0 best solutions below