jQWidgets Forums

jQuery UI Widgets Forums Grid JqxGrid cellclassname cell colours

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • JqxGrid cellclassname cell colours #104283

    pedro10
    Participant

    Hi,

    I was looking at the example code shown here.

    When cellclass (cellclassname) is called, instead of “return ‘red’;” for example, can the background colour be set directly such as “return {background-color: red} ?
    The reason is, for my app the user selects their own colours for the cells and they will never be the same. Ideally, the colour red comes from a variable, possibly from an array.

    Also, the value of the cell needs to be compared to another value in the column next to it before the colour is set. Is there a way to compare the two neighbouring column values then set the colour?

    Thank you

    JqxGrid cellclassname cell colours #104300

    Martin
    Participant

    Hello pedro10,

    The cellclassname callback is used for adding a class to the cells in the column.
    You can set the style using jQuery after that.

    For getting the value from another column you can simply use the getcellvalue method.
    Here is an Example.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/

    JqxGrid cellclassname cell colours #104309

    pedro10
    Participant

    Thanks for your reply.

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

You must be logged in to reply to this topic.