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: []//表头
    }
  • 相关阅读:
    抽奖概率算法
    redis启动异常
    php如何快速读取大文件
    nginx反向代理解决跨域
    sublime修改侧边栏字体
    curl
    公众号开发一
    数组
    在windows下用vagrant建立lnmp开发环境
    gets--vs--fgets
  • 原文地址:https://www.cnblogs.com/fengziblog/p/10607250.html
Copyright © 2011-2022 走看看