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
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