PDA

View Full Version : ActionColumn on grid not working in extjs v4



mk.ranjan
7 Nov 2012, 11:45 PM
Hi, Am facing issue with actioncolumn, It is not working in my case, & unable to identify the reason also.
For safe, i am adding actioncolumn code given in sencha doc in kitchensink application, but it is not working and not displaying the icon or text or any html on grid rows.
Below is my code:


Ext.define('KitchenSink.view.examples.grids.BasicGrid', { extend: 'KitchenSink.view.examples.Example',
requires: [
'Ext.grid.Panel',
'KitchenSink.store.Restaurants'
],

items: [
{
xtype: 'grid',

title: 'Restaurants',
frame: true,

store: 'Restaurants',

columns: [
{ text: 'Name', flex: 1, dataIndex: 'name' },
{ text: 'Cuisine', flex: 1, dataIndex: 'cuisine' },
{
text: 'Action',
xtype:'actioncolumn',
width:50,
items: [{
icon: 'extjs/examples/shared/icons/fam/cog_edit.png', // Use a URL in the icon config
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Edit " + rec.get('firstname'));
}
},{
icon: 'extjs/examples/restful/images/delete.png',
tooltip: 'Delete',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Terminate " + rec.get('firstname'));
}
}]
}
]
}
]
});




Please help me out as i spent multiple hours on it till now

vietits
8 Nov 2012, 2:25 AM
Kitchen Sink example use "ext-neptune.js" which overrides Ext.grid.column.Column and this will ignore Ext.grid.column.Action.defaultRenderer. Try to remove the following line from index.html:


<script type="text/javascript" src="../../ext-neptune.js"></script>

mk.ranjan
8 Nov 2012, 3:56 AM
Thanks, it worked..

corneadoug
14 Dec 2012, 1:12 AM
No way to make it work by keeping neptune.js?