3liz / lizmap-javascript-scripts

Scripts for Lizmap Web Client
Mozilla Public License 2.0
22 stars 41 forks source link

smartFilter - v.trim is not a function #49

Open josemvm opened 2 years ago

josemvm commented 2 years ago

hi

i' am trying to adapt this script to one of my projecs but i got this error and nothing happens...

imagem

thanks

josemvm commented 2 years ago

https://github.com/3liz/lizmap-web-client/issues/1918

josemvm commented 2 years ago

i foundt he problem, i have a fields as integer type, not as string type...

can i solve the probelm using the num.toString () method? i'm trying to apply something like this var v = feat.properties[num.toString(field])] or var v = num.toString(feat.properties[field]) but it doesn't work... i don't know the correct syntax.

can you help me please? how i can do it? thanks a lot

josemvm commented 2 years ago

i can convert integer fields to string fields with virtual fields but it's not so clean...