Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Dynamically changing the style of each cell in ListGrid

    I am using SmartGWT version 2.0.
    I am actually changing the values of cells dynamically in ListGrid by using the method record.setAttribute() and redrawing the grid. In this case the style as set in setEditPendingCSSText() method doesn't apply to these cells. Is there a way where i can dynamically change the styles of those particular cells?

    #2
    see ListGrid.getCellCSSText(ListGridRecord record, int rowNum,int colNum)

    you override that method in ListGrid and return whatever CSS you like.

    Comment


      #3
      First, please upgrade to the latest version of SmartGWT. You are working on a version that is a year and a half old and the API's mentioned below may not be supported in that version.

      You don't need to redraw to entire ListGrid, just call refreshCell(..) or refreshRow(..)

      Override getCellStyle or getCellCSSText to dynamically chance the style of the cell.

      Sanjiv

      Comment


        #4
        Yes, we are in the process of migrating to the new version.

        If i still use the methods you mentioned i don't think i could achieve the functionality i want. Those methods would always change the style of the cell irrespective of whether the value has been edited or not.

        Basically my question was when we dynamically change the value of a cell using record.setAttribute() why doesn't setEditPendingCSSText() apply for that? Is there any other way where this can happen?
        Last edited by swetan; 7 Jun 2011, 05:20.

        Comment

        Working...
        X