ext css样式更换

属性可以是一个函数也可以是字符串,这个知识点是通过函数来实现的。函数参数列表如下:

  1. value : 当前待渲染的单元格值,即表格中某行某列的值,类型为:Object
  2. metaData : 当前待渲染的单元格元数据. 支持的属性有: tdCls, tdAttr, and style。类型为:Object
  3. record : 当前待渲染的单元格所在行数据Model,类型为:Ext.data.Model
  4. rowIndex : 当前待渲染的单元格所在行数,类型为:Number
  5. colIndex : 当前待渲染的单元格所在列数,类型为:Number
  6. store : 当前数据Store,类型为:Ext.data.Store
  7. view : 当前视图,类型为:Ext.view.View
  8. return : 返回类型为:String,返回结果为待渲染的HTML代码。

直接通过样式改变背景

.x-grid-row td 这里一定要加td

      height:35px;   

background-color:rgb(255,0,255) !important;  

       /* border: 5pxsolid rgb(0,255,255) !important;

       }

动态改变背景

viewConfig: {

       stripeRows: false,

       getRowClass: function(record,rowIndex, rowParams, store) {

        if(rowIndex%2 ==0){

            return  'gril-row' ;

        }else{

           return'';

}  }

.gril-row.x-grid-cell {这里一定要加cell样式而且还有关闭继承

         border-top: 5px solid #eceff6;

         background-color: rgb(0,255,255);

      }

悬浮状态背景样式

.x-grid-row-over.x-grid-cell {

            font-weight: bold;

            color: red;

            background-color: red ;

}

选中样式

.x-grid-row-selected.x-grid-cell-inner {

            background-color: red ;

}

grid竖线

columnLines:true;

panel给背景

.x-panel.x-panel-body{

            background-color: red ;

}

tree树桩换图标

.folder_close

{background: url("images/icons/fam/cog.gif")no-repeat center !important;

}

iconCls:'folder_close',

猜你喜欢

转载自blog.csdn.net/yemaiqingxiang/article/details/78918788
ext