PDA

View Full Version : reload content of tab on TabPanel when add new item



steven000
27 Apr 2011, 6:29 AM
Hello guys

I use a TabPanel with 2 tabs, one tab for adding new item and another tab for listing all items
When i add a new item on tab 1, i want to see this item on tab 2 immediately.

Please help me some solutions how to reload content of tab when store changes.

Thanks in advance
Steven

friend
27 Apr 2011, 6:42 AM
Does the second tab contain a grid?

steven000
27 Apr 2011, 5:58 PM
Hi,

the 2nd tab is a NestedList.

steven000
27 Apr 2011, 11:06 PM
I've updated the 2nd tab as below code:



var activeList = nestedList.getActiveItem();
var listItem = Ext.ModelMgr.create({
'id' : obj.user.id,
'name' : obj.user.name,
'leaf' : true
}, 'ListItem');

activeList.store.add(listItem);
nestedList.doLayout();


But i met another issue is i can't click on this item just added.

Is there any solution?

Thanks

steven000
27 Apr 2011, 11:09 PM
I've updated the 2nd tab as below code:



var activeList = nestedList.getActiveItem();
var listItem = Ext.ModelMgr.create({
'id' : obj.user.id,
'name' : obj.user.name,
'leaf' : true
}, 'ListItem');

activeList.store.add(listItem);
nestedList.doLayout();


But i met another issue is i can't click on this item just added.

Is there any solution?

Thanks

friend
28 Apr 2011, 9:07 AM
You may be posting in the wrong forum. Isn't NestedList from the Sencha Touch demos?

And isn't Ext.ModelMgr from ExtJs v4?