Hello,
I’m trying to load a color value (in hex, e.g. “abcdef”, without the “#”) from the database.
myfrm.load(“loadValues.php”); loads the values into “myfrm”. In “loadValues.php” I use the ->renderSQL(); method to load and render the data into my form.
Now, two issues arise by doing this.
1st - The colorpicker won’t be filled. I tried to fill the colorpicker in an empty form by using:
frm.getColorPicker(“mycolorpicker”).setColor("#abcdef"); - this didn’t set the value in the colorpicker.
2nd - I also use Calendar objects, so the user can enter dates easily. Now, the problem that arises here is that a “null” value in the database will cause JavaScript to abruptly stop parsing due to a null exception. This error is thrown in dhtmlx.js.
Those errors are not intertwined (because the order of the objects does matter, everything behind “null” is not rendered, everything before “null” is actually a-ok).
How can I solve these issues?
A quick recap:
after .load() ;in JavaScript a PHP file is called. The PHP file responds with the return value of ->renderSQL(); which the JavaScript interprets. The ColorPicker is not set and if a Calendar object is null, dhtmlx.js throws a null exception (and stops).