zoukankan      html  css  js  c++  java
  • Extjs关于grid 行变色

        //頁面加載時創建grid
        var gdProductStock = Ext.create('Ext.grid.Panel', {
            id: 'gdProductStock',
            store: ProductStockStore,
            height: '600',
            columnLines: true,
            frame: true,
            hidden: true,
           
            columns: [
                { xtype: 'rownumberer'},
                { header: ITEMID, dataIndex: 'item_id', 150, align: 'center' },
                { header: PRODUCTID, dataIndex: 'product_id', 150, align: 'center' },
                { header: PRODUCTSTOCK, dataIndex: 'item_stock', 150, align: 'center' },
                { header: PRODUCTALARM, dataIndex: 'item_alarm', 150, align: 'center' }
            ],
            listeners: {
                scrollershow: function (scroller) {
                    if (scroller && scroller.scrollEl) {
                        scroller.clearManagedListeners();
                        scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
                    }
                }
            },
            viewConfig: {
                forceFit: true,

               getRowClass: function (record, rowIndex, rowParams, store) {
                    if (record.data.type == "1") {
                        return 'product_stock_type';//注意这里返回的是定义好的css类;列如:(.ppp_ddd_sss div{background-color:red})定义到你页面访问到的css文件里。
                    }
                }
            }
        });

  • 相关阅读:
    enum
    爬虫实战2:爬头条网美图--Ajax图片加载处理
    爬虫实战1:使用requests和正则爬取电影信息
    爬虫7:selenium
    爬虫6:pyquery库
    爬虫5:beautifulsoup
    爬虫4:re库
    爬虫3:requests库
    爬虫2:urllib
    爬虫1:概述
  • 原文地址:https://www.cnblogs.com/wzj-520j/p/4063013.html
Copyright © 2011-2022 走看看