Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Force Colour of Selected Row
25/09/2008
09:52
Avatar
Larry D
Larry D
Member
Members
Forum Posts: 30
Member Since:
16/09/2008
sp_UserOfflineSmall Offline

Using the basic template if I select a row the row background turns blue.

Any black cell color turns white (which is good) but if a cell color is specifically set with setCell

jQuery(”#a_today”).setCell(rowid,’l_wins’,”,{color:’red’});

then that color will not change to white. This color clashes with some cells when they are highlighted.

Is it possible to force all selectedrow cell colors to white?

--------------

This is something I tried:

onSelectRow: function(id){
if(id && id!==lastsel){
var myrowdata = jQuery('#a_today').setCell(id,'name','',{color:'white'});
lastsel=id;
}
},

That sort of works in that it does change the cell color of name to white when the row is selected.

But if I then select another row it stays white (and thus is white on a white background - it doesn't go back to the original cell color.

26/09/2008
04:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

First I reccomend to define in CSS a class myclas, then

onSelectRow: function(id){
if(id && id!==lastsel){
  jQuery(’#’+id).addClass("myclass");

  jQuery(’#’+lastsel).removeClass("myclass");
lastsel=id;
}
}

This will work since the id is acctually the id of the selected row

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

01/10/2008
06:13
Avatar
Larry D
Larry D
Member
Members
Forum Posts: 30
Member Since:
16/09/2008
sp_UserOfflineSmall Offline

Tony, I can use that method to change some css of the class but not the color.

.rowselected{color: #ff0000; font-size:20px}

—-

jQuery(’#'+id).addClass(’rowselected’);
jQuery(’#'+lastsel).removeClass(’rowselected’);

If I click on a row the row changes to 20px font size and reverts if I then click a differnt row. That proves this method does change the css.

Unfortunately the cell color stays exactly the same instead of being forced to red.

01/10/2008
06:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

try this:

.rowselected{ font-size:20px}

.rowselected td {color: #ff0000;}

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

02/10/2008
15:34
Avatar
Larry D
Larry D
Member
Members
Forum Posts: 30
Member Since:
16/09/2008
sp_UserOfflineSmall Offline

I could not get that to work Tony.

Once again the font size changes but the color stays whatever the cell is set at. Tried in FF and IE.

Cheers.

03/10/2008
02:23
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Sorry I missed something

.rowselected tr td {color: #ff0000;} or

.rowselected tr>td {color: #ff0000;}

should work

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

03/10/2008
03:44
Avatar
Larry D
Larry D
Member
Members
Forum Posts: 30
Member Since:
16/09/2008
sp_UserOfflineSmall Offline

still no good sorry tony

03/10/2008
12:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I will try to prepare example of this.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

12/06/2012
14:56
Avatar
shaoli
New Member
Members
Forum Posts: 1
Member Since:
12/06/2012
sp_UserOfflineSmall Offline

hi tony,

i'm facing the same problem, not able to change the color of the selected row.. please help!!!Frown

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
57 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information