ExtJS grid to set a column background color and font Color implementation method _extjs

Source: Internet
Author: User
CSS code:
Copy Code code as follows:

. x-grid-back-red {
Background: #FF0000;
}


JS Code:
Copy Code code as follows:

{
Header: ' Split type ',
Dataindex: ' Dividetype ',
Renderer:function (v,m) {
m.css= ' x-grid-back-red ';
return v;
},
Width:60
}

Or you can write it directly.
Copy Code code as follows:

{
Header: ' Number ',
Dataindex: ' Fcid ',
CSS: ' background: #FF0000; ',
Width:40
}

ExtJS Grid to set a line font color
CSS code:

Copy Code code as follows:

. x-grid-record-red table{
Color: #FF0000;
}

JS Code:
Code
Copy Code code as follows:

Viewconfig: {
Forcefit:true,
Getrowclass:function (Record,rowindex,rowparams,store) {
Disable data display red
if (record.data.zt==0) {
Return ' x-grid-record-red ';
}else{
Return ";
}
}
},

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.