jQWidgets Forums

jQuery UI Widgets Forums Grid GridRow Background Color depends on cell status Colors

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 9 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • nagaveni
    Participant

    Hi,

    I have requirement to apply row background color dynamically in jqxgrid.I’m using below code

    var bgcolor = rowdata.BackgroundColor;
    var fontcolor = rowdata.TextColor;
    var id = “row” + row + “LoanActivityGrid”;

    $(“#”).find(“.jqx-grid-cell”).css(“background-color”, “#” + bgcolor);
    $(“#” + id).find(“.jqx-grid-cell”).css(“border-color”, “#” + fontcolor);
    $(“#” + id).css(“color”, “#” + fontcolor);

    it is working find on grid load event but i’m getting issue in paging,filtering and sorting i’m getting issue. My issue is i’m getting same row backgroundcolor which we have in previous(what are styles we have applied in paging1 same background color i’m getting next page also).Because in my above code wehen i goto Page 2 I am getting rowid’s 50(my paging value set 0 to 49) But html again i it will starting to row0 please let us know the solution for this.


    Peter Stoev
    Keymaster

    Hi nagaveni,

    Your approach is wrong. Please, look at our examples available online. Even the first demo has custom styling of Cells.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    nagaveni
    Participant

    Hi,

    I’m getting background color from DB i want to apply that bgcolor to entire row in Jqxgrid.I already trying its working fine in pageload but i’m getting issue in paging,filtering and sorting.Please check once any solution for this issue.

    Thanks,Regards,
    Nagaveni


    Peter Stoev
    Keymaster

    Hi Nagaveni,

    I wrote you what you should do and It is – look at the Grid’s first example which demonstrates how to customize correctly the rendering of Grid’s cells. The same approach is Applicable for All cells in a row and the row is passed as parameter. Another very similar approach is through the cellclassname column property which can be set to a function: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridcellclass.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.