columns: [
sm1,
{ header: 'id', dataIndex: 'id', width:35,hidden:true }, //
{ header: '名称[Name]', dataIndex: "name", width:70, editor: new Ext.form.TextField({allowBlank: false}),},
{ header: ' *** 作',width:60, dataIndex: 'id',renderer:function (v) {
return '<input type="button" value="删除" onClick="javascript: alert('+v+')"'
}}
],
})
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'))
}
可以看看官方提供的样例,写的很清楚~~~
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)