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
jqGrid: Set a fixed background-color for an entire column
13/02/2010
02:25
Avatar
carlos.vita
Member
Members
Forum Posts: 5
Member Since:
13/02/2010
sp_UserOfflineSmall Offline

Hi,

    How can I set the background-color for an entire column in jqGrid?

    In the colModel array, I've tried to add:

--> color: yellow

--> background-color: yellow"

--> style: 'background-color: yellow'

    None of this has worked.

    I also read the documents about building a custom formatter, but I was unable to make it work. I didn't know how to change the style for a cell element.

    My goal is to have a column that has a different colour, just to help the user to identify that particular important column.

Can someone help me?

Regards,

Carlos

17/02/2010
12:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

define your own class and add the class in colmodel. Look here how to do this

http://www.trirand.com/jqgridw.....el_options

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.

18/02/2010
14:09
Avatar
carlos.vita
Member
Members
Forum Posts: 5
Member Since:
13/02/2010
sp_UserOfflineSmall Offline

Hi Tony,

Thank you for your quick response.

I tried that option and I was unable to change the column class.

I also Googled for examples but I was no luck.

I have something like this in my PHP file:

<STYLE>

        .cvteste {
            background-color: green;
        }

</STYLE>

<SCRIPT type='text/javascript'>

 jQuery('document').ready(function() {

   jQuery('#tbl_table_antiguidadeSaldos').jqGrid({

              ......

              ......

                colModel: [
                    {name:'field_x',         index:'field_x',         align: 'left',  width:  35, classes: 'cvteste'},

               .....

               ....

  });

});

</SCRIPT>

This is not working.

I'm a little rookie on this. Can you please help me?

Regards,

Carlos

20/02/2010
12:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello

Try

<STYLE>

        .cvteste {
            background-color: green !important;
        }

</STYLE>

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.

25/02/2010
17:18
Avatar
carlos.vita
Member
Members
Forum Posts: 5
Member Since:
13/02/2010
sp_UserOfflineSmall Offline

Hello Tony,

    Thank you very much. Its working 100% now.

Best regards,

Carlos

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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