Announcement

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

    Problem: dynamic background color for Listgrid cells

    Hi,

    I'm using SMARTGWT 3.0 Build : 11-September-2012.
    I use getBaseStyle on my Listgrid to make cell's background change in a dynamic way.

    myGrid=new ListGrid(){
    @Override
    protected String getBaseStyle(ListGridRecord record, int rowNum, int colNum) {

    if(cell 2 == null) {
    return super.getBaseStyle(record, rowNum, colNum);
    }
    else if(value(cell 1) > value(cell 2)) {
    return "redBackground";
    }
    else if(value(cell 1) < = value(cell 2) ) {
    return "greenBackground";
    }

    It works fine for some rows example: image beforeFilter, row 1, column 7 and column 8 . For others (in the same image beforeFilter) example row 2 in the listgrid, the row background is gray but for the cells which have to be red or green, they are white as they are highlighted on hover...so something is happening but i can't understand what.
    More weird : when i filter the results, the cells which have the problem, have the good background. (the row 2 on the first image beforeFilter is the row 1 on the second image afterFilter and we can see that the background is correct.)


    Do you have any idea about this ?


    Thanks for your reply.
    Attached Files

    #2
    Help me please, i can't find a solution for this issue.

    Thanks in advance.

    Comment


      #3
      if the issue is not clear, please tell me to explain it more...

      Comment

      Working...
      X