PDA

View Full Version : Unable to load editable grid



Chellakrishnan
8 Apr 2012, 11:44 PM
Hi all, I've want to make my grid as editable, i used the code as follows,


var Contacts = Ext.create('Ext.data.Store', {
model: 'Contact',
data: [
{name: 'Loiane', email: 'me@loiane.com', phone: '1234-5678'},
{name: 'Peter', email: 'peter@email.com', phone: '2222-2222'},
{name: 'Ane', email: 'ane@email.com', phone: '3333-3333'},
{name: 'Harry', email: 'harry@email.com', phone: '4444-4444'},
{name: 'Camile', email: 'camile@email.com', phone: '5555-5555'}
]
});
var firstGrid = new Ext.create('Ext.grid.Panel', {
renderTo: Ext.getBody(),
frame: true,
store: Contacts,
width: 350,
title: 'Contacts',
selType: 'cellmodel',
columns: [{
text: 'Name',
flex: 1,
dataIndex: 'name'
},{
text: 'Email',
flex: 1,
dataIndex: 'email',
editor: {
xtype:'textfield',
allowBlank:false
}
},{
text: 'Phone',
flex: 1,
dataIndex: 'phone',
editor: {
xtype:'textfield',
allowBlank:false
}
}],
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
]
});


//Simple 'border layout' panel to house both grids
var displayPanel = new Ext.Panel({
width : 720,
height : 300,
layout : 'hbox',
renderTo : 'panel',
defaults : { flex : 1 }, //auto stretch
layoutConfig : { align : 'stretch' },
items : [
firstGrid
],
bodyStyle: 'background-color:#E6ECF4;border:none;',
});








This code returns following error,
error in rendering Json :TypeError: types[config.xtype || defaultType] is not a constructor


Can Anyone help me ?..
Thanks in advance...

mitchellsimoens
9 Apr 2012, 4:19 AM
Do you have all the classes loaded that this example uses?