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
Cell Background Color
09/05/2009
16:01
Avatar
genti15al
Member
Members
Forum Posts: 4
Member Since:
09/05/2009
sp_UserOfflineSmall Offline

Hello everyone,

I was wondering if jqGrid currently allows changing the background color of a cell. I have searched through most of the documentation and the demos  and I couldn't find anything about this.

Anyone has a hint how can this be achieved currently?

Thank you in advance,

Genti

10/05/2009
08:45
Avatar
akremedy
California, USA
Member
Members
Forum Posts: 37
Member Since:
16/12/2008
sp_UserOfflineSmall Offline

Genti, use setCell (see Basid Grids > Methods in docs for more information).  Here is a working example that sets the background color of one cell to red on a specific condition:

jQuery(document).ready(function(){
jQuery("#mylinks_grid_table").jqGrid({
afterInsertRow:function(row_id,rData) {
if(rData['share'] == 'yes') {
jQuery("#mylinks_grid_table").setCell(row_id,'share','',{background:'red'},{title:'This link has been shared'});
}
},
caption: 'My Family\\'s Links',
colModel :[
{name:'id', index:'id', width:40, align:'center',editable:false,editoptions:{readonly:true,size:10},hidden:true},
{name:'flag', index:'flag', width:50, align:'center',editable:false,editoptions:{readonly:true},hidden:false},
{name:'added', index:'added', width: 70, editable:false, sortable:true, hidden:true},
{name:'share', index:'share', width: 60, align:'center',editable:true,edittype:"checkbox",editoptions:{value:"yes:no"}},
{name:'name', index:'name', width: 200, editable:true,},
{name:'link', index:'link', width: 301, editable:true, formatter:'link',formatoptions:{target:"_new"},editrules:{url:true}}
],

Hope that helps,

Adam

10/05/2009
12:57
Avatar
genti15al
Member
Members
Forum Posts: 4
Member Since:
09/05/2009
sp_UserOfflineSmall Offline

Hi Adam,

That did it! Thank you for your help! Never thought it was this easy.

Thanks again,

Genti

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
89 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