Jan 24, 2013, 4:36 PM
[CLOSED] Problem with TabStrib BeforetabChange event
Hi guys,
I have a tabStrib which contains two tabs. I want to make a control on tab change i.e if I modified data on a tab I want to show messageBox if he wants to save data or not. If yes I call an direct method to do the save, if no i do nothing and then tabchange happen. My problem is that I allways return false in my js BeforeTabChange method and I dont know how to recall it after messageBox.
Examples of my code
aspx
I have a tabStrib which contains two tabs. I want to make a control on tab change i.e if I modified data on a tab I want to show messageBox if he wants to save data or not. If yes I call an direct method to do the save, if no i do nothing and then tabchange happen. My problem is that I allways return false in my js BeforeTabChange method and I dont know how to recall it after messageBox.
Examples of my code
aspx
<ext:TabStrip ID="TabStripAdmin" runat="server">
<Items>
<ext:Tab Text="<%$ Resources:Administration, UserRightGroups %>" ActionItemID="PanelGroupRightAdmin" />
<ext:Tab Text="<%$ Resources:Administration, Users %>" ActionItemID="PanelUserAdmin" />
</Items>
<Listeners>
<BeforeTabChange Fn="BeForeTabChange" />
</Listeners>
</ext:TabStrip>
jsvar BeForeTabChange = function (item, newTab, currentTab) {
App.direct.OnConfirmGroupTabChange();
return false;
}
cs [DirectMethod]
public void OnConfirmGroupTabChange()
{
X.Msg.Confirm(Resources.Administration.Warning, Resources.Administration.TabChangeConfirmation, new JFunction { Fn = "ConfirmGroupTabChange" }).Show();
}
jsvar ConfirmGroupTabChange = function (response) {
if (response == 'yes') {
App.direct.SaveMethod();
// here I want to switch to PanelUserAdmin (how can I do ???). I tried this but it doesn't work
App.TabStripAdmin.setActiveTab(Ext.getCmp('PanelUserAdmin'));
}
else {
// here I want to switch to PanelUserAdmin (how can I do ???). I tried this but it doesn't work
App.TabStripAdmin.setActiveTab(Ext.getCmp('PanelUserAdmin'));
}
}
Thank you in advance.
Last edited by Daniil; Jan 25, 2013 at 12:12 PM.
Reason: [CLOSED]