Author Topic: How to change row color depending on its content dynamically in v.2.x  (Read 4298 times)

SureshB

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 32
    • View Profile
Hi,

I am using the below lines to change color of a row ar run time.


         tr.pq-row-rejected td {
                background-color: #FDD2D2;
            }

 $grid.pqGrid("addClass", { rowIndx: rowIndx, cls: 'pq-row-rejected' });

This is working fine for me.

But I need to set the color of the rows by reading color value from a table.
Color value is not fixed and user may change color at run time.

Please let me know How to set selected color at run time to a row background in pqGrid without using fixed class?
I am using Paramquery 2.x version.

Thank you.
 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
column.render() callback and classes are the only way to set styles of rows /cell dynamically in 2.x.

I understand it's not suitable to change background dynamically to any color value.

You need to upgrade to version 3.x to set background style/ colors dynamically

http://paramquery.com/pro/demos/condition_style

SureshB

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 32
    • View Profile
Oh!

Okay. Thank you for your suggestion.:)