ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: SureshB on July 08, 2016, 03:50:43 am

Title: How to change row color depending on its content dynamically in v.2.x
Post by: SureshB on July 08, 2016, 03:50:43 am
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.
 
Title: Re: How to change row color depending on its content dynamically in v.2.x
Post by: paramvir on July 11, 2016, 10:02:47 am
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
Title: Re: How to change row color depending on its content dynamically in v.2.x
Post by: SureshB on July 13, 2016, 08:13:25 pm
Oh!

Okay. Thank you for your suggestion.:)