This topic is locked
[SOLVED]

 Row-Color change after click/event?

6/18/2011 7:10:44 AM
PHPRunner General questions
M
mickna author

Again row color, I know.

All tips & tricks regarding changing the row color works fine for me.

But this color change is some kind of static.

I changed some row colors as described with $row["rowstyle"]='style="background:#CAA';

Fine. Now my row is a light red.
What I want (need) to do: If a user click on view (popup!) of this row, I would like to reset the color of the row from light red to the normal color.

I believe this could be done, as all rows have classes with an id (e.g.: <tr classes="shade" id="gridRow4" style=....>

Of course as I am using popup view, I can not do it via an event on list page.
Real example:

  • All rows of new messages from a private messages systems are light red.
  • User click on "view" of one of these messages, popup with detailed view
  • Color of this row should be reseted.
    Any ideas?

    Thanks,

    mickna

C
cgphp 6/19/2011

mickna,
you could use something like this in the Javascript OnLoad event of the list page:

$('[id^="viewLink"]').click(function(e){

$(this).parents().eq(1).removeAttr("style");

});


If you want a permanent change (the color of the row will be still reset after a page refresh), you need to keep a session var after clicking

the view link or keep a boolen flag in the DB.
Cheers,

CGphp

M
mickna author 6/19/2011

Holy Moly!
Thank you so much CGphp. That works like a charm.