com.inductiveautomation.ignition.client.util.gui.color.ColorEditor is the class - you can import that and create an instance of it, but actually using it will be tricky. If you use a power table, you can use some static methods in that class - com.inductiveautomation.ignition.client.util.gui.color.ColorEditor#createTableCellEditor / createTableCellRenderer; using them natively in a popup frame like system.gui.chooseColor does would be more involved.
How can I use the com.inductiveautomation.ignition.client.util.gui.color.ColorEditor for that?
I need to color these five squares to what color the user chooses…
The same code should work - you’ll have to implement isCellEditable and onCellEdited as well, but the default scripts should work. You’ll also want to make your dataset with the appropriate cells, making sure they’re actually Color type cells.
OK, I managed to create a power table with a color type cell in v7.9.13.
But there is no “drop down” for colors… click on the cell does nothing…
When I open the window in the designer I get this error in the output console:
Fwiw, letting the operator change alarm colours doesn’t sound like the best idea. These are better off being standardised so that all operators know exactly what they mean and they apply for any person, for any page. Just my 2c
Close the window and reopen it. The initialize function only runs when the power table is first created, and doesn’t re-run when the function is changed, so the renderer client property hasn’t been set up.
Thank you. Your code works flawlessly…
My problem was that I didn’t check the editable checkbox in the Table Customizer. I totally forgot about it.
Now everything is working and it’s already in production and users are happy.