jQWidgets Forums

jQuery UI Widgets Forums Grid cellrenderer based on another column value

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • cellrenderer based on another column value #32793

    m0j0r1s1ng
    Participant

    I am trying to add a heatmap to my grid. In my DB I created a view that has a calculated column that is the percentage of the value column as compared to the rest of the rows… example:

    name: player1, score: 300, score_heatmap: .20
    name: player2, score: 200, score_heatmap: .13
    name: player3, score: 500, score_heatmap: .33
    name: player4, score: 500, score_heatmap: .33
    

    so my grid is rows of name and columns of score and I want to format my score column as:

    score_heatmap < .10 then red else
    score_heatmap < .20 then yellow else
    score_heatmap < .30 then green else
    score_heatmap = blue

    but I cannot figure out how I know the value in a column (I was adding score_heatmap as a hidden column to my grid to make it part of my row) when in the cellsrenderer function.

    thanks

    cellrenderer based on another column value #32830

    Peter Stoev
    Keymaster

    Hi m0j0r1s1ng,

    The 6th parameter of the cellsrenderer is the row’s Data(Key/Value pairs where the key is the columns datafields)

    cellsrenderer(row, datafield, value, defaultcellsrenderer, columnProperties, rowData)

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.