Change the color of Ext. Grid. gridpanel.

Source: Internet
Author: User

Sometimes we need to change the grid data to a special color based on a tag in the store. For example, in my project, the record with abnormal user status (the Field memberstatus is not 1) is dimmed. 'X-grid-record-gray'
It is a CSS style that has been defined on the page. The viewconfig information in the grid is truncated below.

Viewconfig :{
Columnstext: "show/hide columns ",
Sortasctext: "Forward order ",
Sortdesctext: "Inverted sorting ",
Forcefit: True,
Getrowclass: function (record, rowindex, rowparams, store ){
// Disable the Gray Display of data
If (record. Data. memberstatus! = '1') {// The user status is abnormal.
Return 'x-grid-record-gray ';
Ext. getcmp ("membergrid"). getselectionmodel (). Lock ();
} Else {
Return '';
}

}

 

 

Ext. Grid. gridpanel: font changes when the mouse slides over a row

When you write a CSS class in the margin book, you can overwrite the class in the original ext-all.css to move the mouse over the gridpanel and change the font.

CSS code
  1. /* Style rows on Mouseover */
  2. X-grid3-row-over. x-grid3-cell-inner {
  3. Font-weight: bold;
  4. Color: '# 545bed'

  5. }

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.