NPellet / visualizer

Other
42 stars 24 forks source link

slick grid and search for empty field #1017

Closed lpatiny closed 7 years ago

lpatiny commented 7 years ago

I would expect that entering in the search '//' would filter for only the empty field but this does not work

targos commented 7 years ago

technically // is not a valid regexp syntax

targos commented 7 years ago

This is how you test for emptyness: /^$/

lpatiny commented 7 years ago

Ok thanks. Indeed '//' is an illegal regexp !

lpatiny commented 7 years ago

Seems /^$/ does not work in fact. Check the report in the view http://www.cheminfo.org/Spectra/Mass/Advanced_analysis/Soups_analysis_from_specific_fragments_and_peptide/index.html

stropitek commented 7 years ago

It works on remarks, but not on Part2

Probably because remarks is an empty string and Part2 is undefined

lpatiny commented 7 years ago

I think indeed in is undefined but how to deal with this. I need to find the column that are undefined in fact ...

stropitek commented 7 years ago

I've made a change in which all values are coerced to Strings. This means for the search engine undefined values are treated exactly as "undefined" strings. Note that because getChildSync returns undefined if the value is null, you cannot make that distinction between null and undefined values when searching

stropitek commented 7 years ago

@lpatiny Can I close this?

lpatiny commented 7 years ago

OK let's close it but it is not really user friendly. Maybe we will think about a better solution once ...

targos commented 7 years ago

Can't you coerce to an empty string in this case ?

stropitek commented 7 years ago

This means you have to search undefined by using a regexp to match an emtpy string, which is misleading IMO. I'd stick to typing undefined (or undef or und, strings are searched with match). Plus you would not be able to make the difference between empty string and null or undefined.