Coloring index field in table

  • 11 April 2022
  • 1 reply
  • 43 views

Userlevel 1
Badge
  • AIMMS Partner
  • 3 replies

Hi AIMMS Community,

Does anyone know if (and how) you can give a complete row in a webUI table a color, instead of just the data fields?

For example, I want to go from:

Data field colored with annotation

To:

Desired coloring

Thank you!


1 reply

Userlevel 4
Badge +3

Hi Imke,

Coloring, custom scripting and writing overly long custom css rules is just my thing, but I needed to discuss this for a bit with a colleague (thanks, Koos) before I finally had my answer for you.

However, that answer will not directly please you, because: no, right now you can’t exactly achieve what you’re after (given the example and how it probably resembles your own data structure).

But that calls for more explanation, of course.

You show that you are well aware of how to apply an annotation to a cell. And you probably also know how to add an annotation class to cells on the row headers. As in: making all ‘Red’ values in s_Index_2 really red.

So you may have also experienced how the current way of adding annotations there is focused on Sets for a single index. But not over multiple indices, so you can’t control the annotation to occur when both ‘Paprika’ and ‘Red’ and a number of values for related p_Sales occurs. The best you can achieve today is making all ‘Red’ column headers red, but not a single one. And that’s where your example is more complex than just a single range of values that has each one occurring only once.

Does this then end here, you probably wonder?
Well, not necessarily.

The best thing to do is to Post this ‘feature request’ in the Ideation section of the Forum. Maybe others turn out to be looking for similar ways to color their data. They could chime in and it can very well make it onto our backlog to build for a future release. One reason I also suggest this, is because I learnt that our newest Combination Chart Widget has some similar ‘annotation features’ below the hood which might be adapted to also work with the Table.

The less convenient option is to try and come up with a piece of javascript that actively monitors table contents and cell classes, hoisting the classes to a row or column when all of them match some criteria. But I do feel like that route easily runs into performance issues or issues with not being applied correctly, since you will be looking at the data ‘from the outside’ and not from within the model. Visible table data is always ‘incomplete’, by nature.

I hope this gives you an idea of how to progress from here. If you have more questions, make sure to come back here on the forum and ask!
 

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator