PDA

View Full Version : Problem with EditorGridPanel



jbeduya
7 Dec 2007, 10:20 AM
I have the following code that makes me sick :(


center = new Ext.TabPanel({
id: 'center',
region: 'center',
activeItem: 0,
items: [
{ title: 'Home', contentEl: 'content' }
]
});

I used a TabPanel for the center of my layout, so that I would be able to add numerous tabs. I then have the following code which will be executed when a button is clicked:


if (center.findById(App.instance.Token.id))
{
center.activate(App.instance.Token.id);
} else
{
var store = new Class.store.TokenSearch();
var grid = new Ext.grid.EditorGridPanel({
id: App.instance.Token.id,
store: store,
cm: App.instance.Token.editableColumnModel,
layout: 'fit',
title: 'Tokens',
autoExpandColumn: 'name',
closable: true
});
store.load();
center.add(grid);
center.activate(grid.id);
}

I did hide the App.instance.Token.editableColumnModel and Class.store.TokenSearch() so that it will not complicate more. It works perfectly fine after adding once. But once I closes the tab, and then add it back, it adds fine but I won't be able to edit it anymore. I do not see any Javascript error on my Firebug console.

Could someone give me an explanation on what I might have done wrong?


Thank you,
Junrey