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_Related Related Topics sp_TopicIcon
Formatting column headers
21/05/2013
23:24
Avatar
steve_o
Member
Members
Forum Posts: 10
Member Since:
02/05/2013
sp_UserOfflineSmall Offline

Can the column headers be formatted, i.e. using a different font, font size, or by boldfacing the font?

If so, how?  I thought setCols might do it, but I don't believe it will.  

The jqGrid I have is a static grid (no sorting).

22/05/2013
03:06
Avatar
TronGrid
New Member
Members
Forum Posts: 2
Member Since:
21/05/2013
sp_UserOfflineSmall Offline

Just paste the following in your CSS:

#YOUR-TABLE-ID {

font: 1.2em Arial,Tahoma,Serif;

}

th{

font-size: 16px  Arial,Tahoma,Serif;

}

22/05/2013
08:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I recommend you to look at documentaion - jqGrid methods.

There is a special method for this purpose.

Regards

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.

22/05/2013
16:39
Avatar
steve_o
Member
Members
Forum Posts: 10
Member Since:
02/05/2013
sp_UserOfflineSmall Offline

tony said:

Hello,

I recommend you to look at documentaion - jqGrid methods.

There is a special method for this purpose.

Regards


Thank you Tony.  BTW - great product.  Slick & fast.

The method you refer to - is it the setLabel method?  (That is what I meant to put in my initial post). If so, I haven't (yet) found examples of setting it (syntax required, etc).  

If not, which method are you referring to?

22/05/2013
18:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I mean the same method. But, why do you not try it?

Trying this will lost you a minute and is not painful ;-)

Regards

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.

22/05/2013
18:33
Avatar
steve_o
Member
Members
Forum Posts: 10
Member Since:
02/05/2013
sp_UserOfflineSmall Offline

I mean the same method. But, why do you not try it?

Trying this will lost you a minute and is not painful ;-)


I'm not objecting to trying it - in fact, I already have.  Without an example of how it can be used, I'm just guessing.  

I've tried:

$("#myGrid").setLabel("Destination","Destination",{"font":"bold"});

$("#myGrid").setLabel("Send Time","Send Time",{"font":"bold"});

but it bolds the first one (in IE only) & doesn't bold the second one.  In firefox, none are bold.

I have this in the loadComplete event function, where I alternate the colors of the rows (which sort of works - even though I have "odd" selected, row # 2,4,6,8 are the ones that are numbered).

Using jqGrid 4.5.2 also.

Does colname in the setLabel method need to match what is specified in the colNames array? Or does it need to match the name field in the colModel array?  

Can it be in the loadComplete event, or should it reside elsewhere?  

My apologies for being thick.  

Thanks!

22/05/2013
19:26
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Ok. It seems the docs are not clear ( I have fixed this). With colName we mean name from colModel.

The method can be put in loadComplete or it will work after the grid is created an put it wher you want.

Note that this method work for the label of the grid header and not for the rows.

Regards

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.

22/05/2013
20:21
Avatar
steve_o
Member
Members
Forum Posts: 10
Member Since:
02/05/2013
sp_UserOfflineSmall Offline

Ok. It seems the docs are not clear ( I have fixed this). With colName we mean name from colModel.

The method can be put in loadComplete or it will work after the grid is created an put it wher you want.

Note that this method work for the label of the grid header and not for the rows.


Thank you for clarifying things in the docs & eliminating some of the (bad) guesswork on my part!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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