PDA

View Full Version : [CLOSED] TabChange



ingbabic
Apr 21, 2015, 4:32 PM
Ok, this is the situation:


Html.X().TabPanel().ID("Main").Height(300).Items
(
Html.X().Panel().ID("MainPanel").Title("Main").Items
(
Html.X().Panel().ID("InnerPanel").Title("Inner panel")
)
,
Html.X().Panel().ID("FirstPanel").Title("First"),
Html.X().Panel().ID("SecondPanel").Title("Second")
)
.DirectEvents(de =>
{
de.TabChange.Url = Url.Action("TabSelectChange");
de.TabChange.ExtraParams.Add(new Parameter("selectedTabId", "newTab.getId()", ParameterMode.Raw));
de.TabChange.ExtraParams.Add(new Parameter("oldTabId", "oldTab.getId()", ParameterMode.Raw));
})


In TabSelectChange I need to have additional info - ID of the inner panel of selected tab(if it exist). It doesn't matter if I take it via parameter, or server side. Please help.

Daniil
Apr 22, 2015, 4:33 PM
Hi @ingbabic,

Probably:

newTab.child("panel").id

Does it work for you?

ingbabic
Apr 23, 2015, 6:42 AM
Yes, it does, thanks :)

Meanwhile I've managed it also with:


newTab.items.items[0].id


(though I don't understand why items property, has it's own items where subcontrols are listed)

Daniil
Apr 23, 2015, 7:41 AM
A container's .items is a MixedCollection.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.container.AbstractContainer-property-items

A MixedCollection has its internal items which is an array.