PDA

View Full Version : [CLOSED] Access Parent item



Digital.Dynamics
May 19, 2012, 8:19 AM
Hi,

I have a main page with TabPanel and inside it 4 panels (north, south, east, west and Center).

In one page loaded in a new panel within the Tabpanel, I want to access the parent page from client side and exactly the 'PanelWest' and disable all items for a period of time.
In version 1.3 it was working fine with the following code :



var DisableTabPanelC = function()
{
parent.PanelWest.setDisabled(true);
for (var i = 0; i < parent.TabPanelC.items.items.length; i++)
{
if (parent.TabPanelC.activeTab != parent.TabPanelC.items.items[i])
parent.TabPanelC.items.items[i].setDisabled(true);
}
};




The code for the main page is :



<ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
<Items>
<ext:Panel ID="PanelNorth" Collapsible="true" Header="false" Region="North"
runat="server" TitleCollapse="false" Height="100" Split="True">
<Content>
<div class="topbanner">
<div class="LeftBanner" />
<div class="RightBanner" />
</div>
</Content>
</ext:Panel>

<ext:Panel ID="PanelSouth" Collapsible="false" Region="South" runat="server" Height="30"
HeaderPosition="None">

</ext:Panel>
<ext:FormPanel ID="PanelWest" runat="server" Region="West" Collapsible="true" Layout="FitLayout"
Split="true" Width="175" LabelAlign="Right">
<TopBar>
<ext:Toolbar ID="ToolbarW" runat="server">
<Items>
<ext:ComboBox ID="ComboBoxW" runat="server" Width="160" Visible="false" DisplayField="Group_En"
ValueField="Group_ID" Mode="Local" ClearFilterOnReset="true" Editable="true"
StoreID="storeEmenuss" SelectOnFocus="true" >
<DirectEvents>
<Select OnEvent="ChangeListItem">
</Select>
</DirectEvents>
</ext:ComboBox>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:TreePanel ID="panelItemW" runat="server" AutoScroll="true">
<Items>
</Items>
<Listeners>
<ItemClick Handler="if (record.isLeaf()) {
e.stopEvent();
loadNodeTab(record.get('href'), record);
} else {
record[record.isExpanded() ? 'collapse' : 'expand']();
}" />
</Listeners>
</ext:TreePanel>
</Items>

</ext:FormPanel>
<ext:FormPanel ID="PanelEast" runat="server" Region="East" Collapsible="true" Layout="Fit"
Split="true" Width="195" LabelAlign="Right" >
<TopBar>
<ext:Toolbar ID="ToolbarE" runat="server">
<Items>
<ext:ComboBox ID="ComboBoxE" runat="server" Visible="false" AutoWidth="true" Width="175"
DisplayField="Group_Ar" ValueField="Group_ID" Mode="Local" Editable="true" StoreID="storeEmenuss"
SelectOnFocus="true" Height="50" >
<DirectEvents>
<Select OnEvent="ChangeListItem">
</Select>
</DirectEvents>
</ext:ComboBox>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:TreePanel ID="panelItemE" runat="server" AutoScroll="true">
<Listeners>
<ItemClick Handler="if (record.isLeaf()) {
e.stopEvent();
loadNodeTab(record.get('href'), record);
} else {
record[record.isExpanded() ? 'collapse' : 'expand']();
}" />
</Listeners>
</ext:TreePanel>
</Items>
</ext:FormPanel>
<ext:Panel ID="PanelCenter" runat="server" Region="Center" Layout="FitLayout" Header="false">

<Items>
<ext:TabPanel ID="TabPanelC" runat="server" AutoScroll="true" AnimScroll="true" ActiveTabIndex="0"
Border="false" Title="Center" EnableTabScroll="true" Height="800" Header="false">
<Items>
<ext:Panel ID="Panel10" runat="server" Layout="Fit" Closable="false" Title="<%$ Resources:ParadigmMres, DefHomePage %>">
<Items>
</Items>
</ext:Panel>
</Items>
<Plugins>
<ext:TabScrollerMenu ID="TabScrollerMenu1" Enabled="true" runat="server" MaxText="50" />
</Plugins>
</ext:TabPanel>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>


Please need urgent help !

Thanks.

Vladimir
May 19, 2012, 8:35 AM
Please note that v2 uses default namespace 'App' thefore you have top use


parent.App.TabPanelC


or you can use empty Namespace in ResourceManager or web.config

Digital.Dynamics
May 19, 2012, 10:06 AM
Thanks a lot Vladimir, It works fine now.

Please mark as closed