{ xtype: 'gridpanel', columns: [ {text: 'NAME', dataIndex: 'name', width: 100}, {text: 'SURNAME', dataIndex: 'surname', width: 100}, { text: 'DELETE', align: 'center', xtype: 'actioncolumn', items: [ { xtype: 'button', text: 'DELETE ME', scale: 'small', handler: function() { alert("Hello World!"); } } ] } ] }
Nex Attempt:
{ xtype: 'gridpanel', columns: [ {text: 'NAME', dataIndex: 'name', width: 100}, {text: 'SURNAME', dataIndex: 'surname', width: 100}, { renderer: function(val,meta,rec) { // generate unique id for an element var id = Ext.id(); Ext.defer(function() { Ext.widget('button', { renderTo: id, text: 'DELETE', scale: 'small', handler: function() { Ext.Msg.alert("Hello World") } }); }, 50); return Ext.String.format('<div id="{0}"></div>', id); } } ] }
source share