Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






Add css classes to colModel properties

UserPost

17:40
08/09/2009


Renso

PA

Member

posts 118

being able to add your own css classes to properties in colModel so that they may be styled accordingly.

03:58
10/09/2009


tony

Sofia, Bulgaria

Moderator

posts 7371

Hello,

Not sure what you mean – do you mean only for the headers or for both headers and rows

Regards

Tony

For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

07:38
10/09/2009


Renso

PA

Member

posts 118

For rows especially Tony, for example I have a list of contacts with their phone numbers and want to style the phne number column based on a class. Maybe something like:


colModel:[
{name: 'Phone', index: 'Phone', edittype: { classes: ['blurMe','smallFont','blueMe'] }
 
]
 

or maybe the formatter with a custom format function will suffice:

colModel:[

{name: 'Phone', index: 'Phone', formatter: {'classes: ['blurMe','smallFont','blueMe'] } }
 
]

with the fmatter:

  $.fn.fmatter.classes = function (el,cellval, opts) {
        var op = $.extend({},opts.classes);
        if(!isUndefined(opts.colModel.formatoptions)) {
            op = $.extend({},op,opts.colModel.formatoptions);
        }
        if(isEmpty(cellval)) {
            cellval = op.defaultValue || 0;
        }
       $(op.classes).each(function(){
            $(el).addClass(this);
       }
    };

 

02:58
11/09/2009


tony

Sofia, Bulgaria

Moderator

posts 7371

Hello,

Thanks.

What about to define this in formatoptions, but in this case we should define formatter. Will think about this.

Regards

Tony


For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site – trirand.net – by the very same guys that created jqGrid.

06:43
17/09/2009


Renso

PA

Member

posts 118

formatoptions seems the most logical place, thanks heaps.


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

215


Currently Online:

127 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 10267

Posts: 30340

Membership:

There are 11030 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1210

markw65 – 179

kobruleht – 144

phicarre – 132

YamilBracho – 124

Renso – 118

Administrators: admin (60 Posts)

Moderators: tony (7371 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information