PDA

View Full Version : [CLOSED] Dynamically Add Tab without postback



crazypsdev
Jun 06, 2008, 1:18 AM
Hello:

Could anyone provide an example for dynamically adding a tab to a tab panel when clicking on a navigation link. I would like to be able to do this without a post back.

I am using v0.5.

thanks,

Rob

geoffrey.mcgill
Jun 06, 2008, 8:55 AM
Hi Rob,

You can create and add a new Tab to a TabPanel with a bit of JavaScript.

Example


<script type="text/javascript">
var addTab = function() {
var tab = new Ext.Panel({
title: "New Tab",
autoLoad: "../AutoLoadData/Simple.aspx"
});

TabPanel1.add(tab);
TabPanel1.setActiveTab(tab);
}
</script>

I also created a full sample demonstrating a couple different options and uploaded to the sandbox. See http://sandbox.ext.net/TabPanel/AddTab.aspx

Hope this helps.

crazypsdev
Jun 07, 2008, 10:20 PM
thank you Geoff!

-Rob

idrissb
Sep 11, 2008, 11:30 PM
Geoff

You may already know that the sandbox examples do not load. can you let me know when they will be accessible.
thank you
idriss

Vladimir
Sep 12, 2008, 4:30 AM
Hi idrissb,

the example on sandbox is working now