當前位置:編程學習大全網 - 網站源碼 - 怎樣為extjs寫的表中的列中的按鈕添加方法。

怎樣為extjs寫的表中的列中的按鈕添加方法。

menuDisabled: true,

sortable: false,

xtype: 'actioncolumn',

width: 50,

items: [{

iconCls: 'sell-col',

tooltip: 'Sell stock',

handler: function(grid, rowIndex, colIndex) {

var rec = grid.getStore().getAt(rowIndex);

Ext.Msg.alert('Sell', 'Sell ' + rec.get('company'));

}

}, {

getClass: function(v, meta, rec) {

if (rec.get('change') < 0) {

return 'alert-col';

} else {

return 'buy-col';

}

},

getTip: function(v, meta, rec) {

if (rec.get('change') < 0) {

return 'Hold stock';

} else {

return 'Buy stock';

}

},

handler: function(grid, rowIndex, colIndex) {

var rec = grid.getStore().getAt(rowIndex),

action = (rec.get('change') < 0 ? 'Hold' : 'Buy');

Ext.Msg.alert(action, action + ' ' + rec.get('company'));

}

可以看看官方提供的樣例,寫的很清楚~~~

  • 上一篇:元氣騎士前傳激活碼在哪兌換
  • 下一篇:“互聯網+醫療”和智慧醫療有區別嗎?
  • copyright 2024編程學習大全網