With normal GridPanel, is not possible to edit value into cell
so, ExtJs extend GridPanel with EditorGridPanel to doing that!
in your case, for edit only third column
Code:
Ext.onReady(function () {
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
// sample static data for the store
var myData = [
['Team Member', 'Resources', 'Employees/Contractors', 'Text', 'Sequence', 'Asceending']
];
// create the data store
var store = new Ext.data.ArrayStore(
{
fields: [
{
name: 'object'
}, {
name: 'field'
}, {
name: 'displayName'
}, {
name: 'type'
}, {
name: 'sorttype'
}, {
name: 'direction'
}]
});
// manually load local data
store.loadData(myData);
// create the Grid
var grid = new Ext.grid.EditorGridPanel(
{
store: store,
columns: [
{
id: 'cate-field',
header: 'Object',
sortable: true
}, {
header: 'Field',
sortable: true,
dataIndex: 'field',
editor: new Ext.form.TextField({
})
}, {
header: 'Display Name',
sortable: true
}, {
header: 'Type',
sortable: true
}, {
header: 'Sort Type',
sortable: true
}, {
header: 'Direction',
sortable: true
}],
stripeRows: true,
autoExpandColumn: 'cate-field',
height: 175,
width: 690,
title: 'Category Field (Axis)',
// config options for stateful behavior
stateful: true,
stateId: 'grid'
});
// render the grid to the specified div in the page
grid.render(document.body);
});
ps: don't forget to use 'dataIndex' and use tag code (=> more easy to read) !