extjs4 grid点击单元格鼠标手形,修改背景色

extjs4让grid的单元格点击时支持手形。

 

Ext.widget('gridpanel', {
    title: 'grid',
    height: 200,
    width: 200,
    renderTo: Ext.getBody(),
    columns: [{
        text: 'Col',
        dataIndex: 'col',
        renderer: function (val, metadata, record) {
            if (record.get('col') == 1) {
                metadata.style = 'background-color: #FFFFCC !important;cursor: pointer;'
            }
            return val;
        },
        listeners:{
             "click":function(grid,cell,row){
                      var r =  grid.store.getAt(row);
              }
       }
    }],
    store: {
        fields: ['col'],
        data: [{
            col: 1
        }, {
            col: 2
        }]
    }
})
 

 

 

你可能感兴趣的:(extjs4)