Author Topic: Color in rows  (Read 4136 times)

paboro

  • Newbie
  • *
  • Posts: 3
    • View Profile
Color in rows
« on: July 02, 2014, 04:46:28 pm »
Hello, first of all, thanks for this good job that is Paramquery.

I have a problem, in my program, I want to set colors to the rows, depending of some factors. I do it with addClass ( I read it fails) but when I do a event, like resize columns, or scroll, etc... It goes white again. Is really important that colors, so I need to fix this. How can I set the colors even if happen a event, or something. There is a jquery function? or some?

Thanks for your time.

Regards

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Color in rows
« Reply #1 on: July 02, 2014, 04:57:52 pm »
paramquery Grid is frequently refreshed due to its design based on virtual rendering.

If you want to do it with jQuery API, you have to use refresh event to add class so that class remains intact whenever grid is refreshed.

http://paramquery.com/api#event-refresh

paboro

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Color in rows
« Reply #2 on: July 02, 2014, 05:05:02 pm »

I actually do, but the first time, when is created it apears in colors because I inicializate it, but in the moment I do a event like resize or scroll it disapear. I have the pqrefresh, and is ok, but only when I refresh with alt+f5 or refresh of browser, but not in the event of the table...

What can I do?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Color in rows
« Reply #3 on: July 02, 2014, 05:22:17 pm »
Whenever the grid is scrolled, column resized, sorted, etc, refresh event is fired.

I mean you could add the code to add classes within refresh event.

$grid.on("pqgridrefresh", function(evt){
   //add classes here

});

paboro

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Color in rows
« Reply #4 on: July 02, 2014, 05:46:13 pm »

Thanks, I already did it, but I just now fixed it, my problem was the cache...

Thanks very much

regards