• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[ANSWERED] Conditionally hide value on grid field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ANSWERED] Conditionally hide value on grid field

    I'm a noobie, so please bear with me.

    I have a grid column numeric field, and when the value = 99, I'd like to not display that value (see attached image).

    So I have an afterRender event binding and I'm trying to do something like this but know that it's not right...

    Code:
    //-- If month = 99, hide it
    var index = filegrid.items.findIndex('dataIndex','VSMONTH');
    If index = 99{
    filegrid.getAt(index).setVisible(false);
    };
    I'm sure I'm way off track... what is the best way to accomplish my goal? Thanks.
    Attached Files

  • #2
    You'd probably be better off using a column renderer to handle that. Just return a blank ("") if value is 99.

    Comment


    • #3
      Thank you. This is my code on the column renderer now and it works great:
      Code:
      if (value == 99){
          return '';
      }
      else{
          return value;
      }

      Comment

      Working...
      X