-
31 Oct 2012 2:36 AM #1
Can a single FormPanel be used in two or more TabPanels at a time
Can a single FormPanel be used in two or more TabPanels at a time
Hi,
I wanna do something like one FormPanel and two Tabs using that same Panel...............Can it be done???
ex:
Code:var form = new Ext.form.FormPanel({ items:[{ xtype:"combo", id:"id_1" },{ xtype:"combo", id:"id_2" },{ xtype:"button", text:"save", handler: function(){ if(tab1){ alert("Save TAB_1 values"); }else{ alert("Save TAB_2 values"); } } }] }); var tabpanel = new NoSwitchTabPanel({ items:[{ id:'tab_1', title: 'TAB_1', layout:'fit', region:'center', hideMode:'offsets', items:[form] // Using same FormPanel in tab_1 },{ id:'tab_2', title: 'TAB_2', layout:'fit', region:'center', hideMode:'offsets', items:[form] // Using same FormPanel in tab_2 }] });
as I applied this code it gave me like "form" was not seen in TAB_1 but was visible in TAB_2 or should be said it rendered in the 2nd Tab but not in Tab 1
Or
Is there another way to do the same n the FormPanel is not a popup it is placed on the center region of border Layout
Thanks n Regards,
Pooja
-
31 Oct 2012 3:11 AM #2
Just add multiple instances of the same form - but you will have to remove all IDs from any components/elements for this to work without causing errors.
-
31 Oct 2012 4:10 AM #3
multiple instances like????
I mean what I need to do for making multiple instances of this form can u give small example ??
-
31 Oct 2012 4:26 AM #4
Here's an example of adding multiple instances of the same form to a tabpanel:
http://jsfiddle.net/Whinters/jzT3p/
-
31 Oct 2012 4:34 AM #5
Thanks willigogs

well this code is in ExtJs 4.1 and MVC model is applied to this
I'll try converting /using same code in ExtJs 3.4 as my full app. is in extjs3.4

-
31 Oct 2012 4:36 AM #6
This is EXTJS 3.4 code

(Notice the scripts being called in the top left panel)
-
31 Oct 2012 4:39 AM #7
oopz sorry.....................will use same code




Reply With Quote