0 Replies Latest reply on Jul 19, 2020 10:46 AM by Keyser

    Interactive GRID - Through javascript change color of salary based on dept

    Richa_Apex

      Hi All,

      I know how to change color for single column through javascript (Dynamic Action + Validation) based on its value but unable to do it based on multiple columns condition.

      If department is RESEARCH, then max salary of employee should be 1000. If department is SALES, then max salary of employee should be 2000.

      Based on above criteria, as user enters value in Interactive GRID for SALARY column, would like to color the font red if salary exceeds 1000 for RESEARCH team. Similarly for SALES team, would like to color red if salary exceeds 2000. Since this is based on multiple column condition i.e., DEPT and SALARY, not able to achieve so far. Hence would like to know how to achieve it based on Javascript. Appreciate any help.

      Thanks in advance.

      Thanks,
      Richa

        • 1. Re: Interactive GRID - Through javascript change color of salary based on dept
          Keyser
          as user enters value in Interactive GRID

           

          there is a good thread about this with some example code (from 2017 so be aware that things may have changed since then)

           

          Interactive Grid conditional highlighting

           

          John Snyders :

           

          The Set Style action is essentially pointless for column items. The reason is that it applies to the column item not the cell. IG uses what is known as the fly weight pattern where form controls are swapped into cells as they become activated and removed when deactivated. This allows an IG to show thousands of rows without having to render all those form control elements. The result is that there is just one APEX item plugin instance for each column kept in a hidden part of the page and only shown when a cell has focus

           

          To change the style of rows or cells based on the content of the row or any other criteria requires using the model API to update record (row) or field (column) metadata. This uses essentially the same mechanism that the Highlight report setting feature uses. The difference is that you have to update the model metadata on the client and must provide your own CSS rules