Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1045
"unbounded row" vs "summary"
posted

Hi experts,

When I read unbounded column section, I see I can append a Total column to a grid, and when I update the values in previous columns, the total column value get updated automatically. Is there a way to do this in a row manner? I'd like to append a total row to my grid, and the value of this row is calculated base on previous rows. When you update values in previous rows, the total row should get updated automatically.

My second question is how to add a red color to this total row cell, when the value is greater than a certain value, say 100.

And I see the summary feature maybe just meet my requirement, if so, how can I make the summary red when the summary is greater than 100?

Thanks in advance.

Parents
  • 15320
    Offline posted

    Hello Ming,

    You can check for example on grid rendered event for the value of the respective summary using summariesFor method, for instance:

    rendered: function(evt, ui){

    var colSummary = $("#grid").igGridSummaries("summariesFor", "Name");

    if(colSummary[0].result > 100){

    $("tr#grid_summaries_footer_row_count td[data-key='Name']").css("background-color", "red")

    }

    }

    But please note that this is just a sample code. The column key will be different on your side and the respective column summary could contain more than one summaries, then you should access the desired summary by its index (in demonstrated code, there is only one summary, therefore the index is 0). If you have any questions, please let me know.

    Regards,

    Tsanna

Reply Children