zoukankan      html  css  js  c++  java
  • Extjs 改变grid行的背景颜色

    ## Ext grid 改变行背景色
    
    Ext.util.CSS.createStyleSheet('.ts {background:#9a9a9bc2;}');//单独创建css样式
    
     {
    
      xtype: 'gridbase',
      region: 'north',
      title: '不含增值税(单位:万元)',
      titleAlign: "center",
      dockedItems: [
      {
      xtype: 'toolbar',
      weight: -10,
      items: [
         {
          xtype: 'mybutton',
          btnType: 'winsave',
          handler: Ext.bind(me._save, me)
         }
        ]
      }
    ],
    id: 'grid1',
    plugins: [Ext.create('Ext.grid.plugin.CellEditing', {clicksToEdit: 1})],
    store: _store1,
    pagingtoolbar: false,
    isLineFeed: true,
    viewConfig: {
        //重点代码
        getRowClass: function (record, rowIndex, rowParams, store) { **
        //设置条件,然后返回想展示的样式
        if (rowIndex === 1 || rowIndex === 3) {
            return 'ts';//样式名字
         } else {
            return ""
        }
    }
     },
    columns: {
        defaults: {
        align: 'center',
    }
    },
    items: []//表头
    }
  • 相关阅读:
    [转]难过的时候看看,也许会豁然开朗
    热爱生活
    [转]MTOM 编码
    11/16
    11/10 The Day Before Single's Day
    About working overtime
    hehe
    The First Blog
    配置MapServer出现的一些问题及解决办法
    Ubuntu 系统下终端快捷键设置
  • 原文地址:https://www.cnblogs.com/fengziblog/p/10607250.html
Copyright © 2011-2022 走看看