In gridframework.js there's the following snippet:
If I have a list which looks like: ["1", "Abc", "1Abc"]And I would like to do a startsWith kind of conditional styling, for the first item it would be marked as a "number" type, which does not have the toLowerCase() method, which in turn leads to an error/crash.
A very simple fix for this would be to just always ensure the value is a String type by using a cast or constructor or ToString() method. (Personally I think using the constructor is the best approach.)
So for example:
cellValue = String(cellValue), comparedValue = String(comparedValue);
It's honestly crazy how there's no enforcing on data types (and that nobody has ever noticed this before?)
hi @Joey Moree
The function implicitly assumes cellValue and comparedValue are strings, but in mixed datasets numeric values can slip through and cause runtime errors when calling toLowerCase(). A simple and safe improvement would be to normalize both values to strings at the start (for example, using String(cellValue) and String(comparedValue)). This would make the logic more defensive and prevent crashes without affecting existing behavior.
This comment perfectly showcases everything that is wrong with the forums nowadays (and why I have stopped engaging with in for the last year).
In case you still didn't understand, I'll try to elaborate within 1 sentence:
"You literally act like an echochamber by repeating everything I mentioned in the original post, this is a bug report aimed towards the Outsystems Team so they can update the official Data Grid component."
In my opinion, most of the systems will use table (data grid maybe) to show the data with the same data type in 1 column. Its rare that data mixes the number and text in the same column. Actually, you have nicely caught the hidden bug which can save a lot of time for others.
Thank you @Joey Moree , please keep this post updated, I also wanna follow the fix