Grid Cell Styler Widget - Javascript rule

0
Hellou Mendixer :-) Im using the Cell Styler Widget from the Marketplace to change the Color of a column, based on the Status. Mendix Marketplace - Grid Cell Styler   so if the Status = new  then the background color should be background-danger. ( later i will need a extra css class but for testing, background-danger is ok)   What im doing wrong in the Javascript rule? The Error: Error while evaluating javascript input: TypeError: Cannot read properties of undefined (reading 'get')    
asked
2 answers
0

Your contextObj has no attribute with the name ‘New’, therefor it finds no object and thus cannot read properties. Change it to

rowObj.get("OrderStatus")===contextObj.get("OrderStatus");

And if that does not solve it, then you can open the inspector in your browser (F12), find the piece of javascript and debug it.

Or with trial and error attempt to do this first with the most simpel statement:  “return true;”, should turn your cell into background-danger. Then “ return rowObj.get("OrderStatus")==’<yourcellcontents>’, see what happens. And so on.

answered
0

Hej Tim,

Solved the Problem with 

return rowObj.get("OrderStatus") == "_New";

The underline was missing.

 

Thanks for you Help

Best Regards

answered