PDA

View Full Version : tab beforetabchange or other method to save form before change



cag3
21 Jun 2007, 4:26 PM
Hello everybody,
I'm new to ext and this is my first post.

I've been strugling with the following:

Ext.onReady(function(){
var tabs = new Ext.TabPanel('tabs1');
tabs.addTab('tab1', "test");
tabs.addTab('tab2', "test2");
tabs.activate('tab1');
});

now i'm trying to save the form in tab1 before it will change over to tab2

i tried this:

// this will be exec twice, which is not good if i want to save data to the server
tabs.on('beforetabchange', function(panel, e, tab){
alert(tab.id);
}

//////////////////////////
i tried this:
tabs.addListener('click',hallo);

this:
tab1.addListener('click',hallo);
or:
tabs.on('click',hallo);

but the function hallo isnt called
//////////////

i'm kinda new to ext and i used to work with prototype.
can someone help me get started, becuase i obviosly are missing some basics of ext?

cag3
25 Jun 2007, 1:27 AM
So uhm, nobody knows how? :p

tryanDLS
25 Jun 2007, 8:15 AM
Looks like there's a bug - beforetabchange is being fired twice on tab activate.