Ext给GridPanel上指定的行制定颜色

来源:互联网 发布:线割编程多久学会 编辑:程序博客网 时间:2024/04/29 08:59
 InventoryGrid = new Ext.grid.GridPanel({
  id: "InventoryGrid",
  store: InventoryStore,
  sm: sm,
  cm: cm,
  loadMask: true,
  autoScroll: true,
  stripeRows: true, //采取grid自动渲染,行列交错!
  columnLines: true,
  border: false,
  viewConfig: {
  //forceFit: true,
  columnsText: "显示/隐藏列",
  sortAscText: "正序排列",
  sortDescText: "倒序排列",
  /*根据条件改变要求行的背景色!
  需要在主页面新建一个css例如:
  <style type="text/css">
  .my_row_style table{ background:Yellow}
  </style>
  然后用下面的方法便可以实现了!见API实例
  */
  getRowClass: function (record, rowIndex, rowParams, store) {
            if (record.data.DayStore <= "50") {
                   return "my_row_style"; 
            }
  }
  },
原创粉丝点击