PDA

View Full Version : Rendering text property with xtype :'actioncolumn'



sixtoedsloth
22 Mar 2012, 8:17 AM
Hi all,

I just wondered whether this was a bug or i have misunderstood the docs?

In the 3rd column of xtype :'actioncolumn' the header Action is not rendering. i.e. 'Action is *NOT* being displayed in the header and remains as a blank. I have forced a rendering by adding the commented out text after the object creation.

Am i doing anything wrong?



Ext.create('Ext.grid.Panel', {
id : 'myPanel',
title: 'Action Column Demo',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{text: 'First Name', dataIndex:'firstname'},
{text: 'Last Name', dataIndex:'lastname'},
{
text: 'Action',
xtype:'actioncolumn',
width:100,
items: [{
icon: '../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') + " " + rec.get('lastname'));
}
},{
icon: '../restful/images/delete.png',
tooltip: 'Delete',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Terminate " + rec.get('firstname')+ " " + rec.get('lastname'));
}
}]
}
],
width: 280,
renderTo: Ext.getBody()
})
//Ext.getCmp('myPanel').columns[2].setText("Action");

mitchellsimoens
22 Mar 2012, 12:33 PM
In 4.0.7 this was a bug. Testing in 4.1.0 RC1 it has been fixed.