PDA

View Full Version : lock on gridcolumn



angelo88
9 Jul 2013, 1:36 AM
hi, i load a json object in a store that i put in gridpanel. i want to lock some xgridcolum but when i put locked true on that columns i obtain that the rows of that columns remain blank and the fields are rendered to the columns that are not locked! please help me
thanks

rajzshkr
10 Jul 2013, 3:26 AM
Use locked:true in the column.It will work.

Thanks!!
Raj

slemmon
10 Jul 2013, 2:17 PM
Is this how you're setting up your grid? If not you might share what you've got currently.



Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name', locked: true },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
lockable: true,
renderTo: Ext.getBody()
});