PDA

View Full Version : Unable to define action column text



harman
10 Aug 2012, 7:23 AM
Hi All,

I just picked up the action column code from sencha docs.
I edit and define text value for action column but cant see it reflected on UI.
Docs say it has text property that sets the header text if i say 'text'.
I think i am missing some silly simple thing.



Ext.create('Ext.data.Store', {
storeId:'employeeStore',
fields:['firstname', 'lastname', 'senority', 'dep', 'hired'],
data:[
{firstname:"Michael", lastname:"Scott"},
{firstname:"Dwight", lastname:"Schrute"},
{firstname:"Jim", lastname:"Halpert"},
{firstname:"Kevin", lastname:"Malone"},
{firstname:"Angela", lastname:"Martin"}
]
});


Ext.create('Ext.grid.Panel', {
title: 'Action Column Demo',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{text: 'First Name', dataIndex:'firstname'},
{text: 'Last Name', dataIndex:'lastname'},
{
xtype:'actioncolumn',
text:'Header',
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'));
}
}]
}
],
width: 250,
renderTo: Ext.getBody()
});

vietits
10 Aug 2012, 5:05 PM
Running your example code with Ext 4.1.1 and Chrome 20, I saw three columns with respective headers: First Name, Last Name and Header. So everything is normal.

harman
13 Aug 2012, 1:05 AM
@vietits

Sorry thats my bad i forgot to tell i am using it on Sencha's editor given in docs for ExtJS 4.0