问题描述
我有1页有2个带加载器的窗口。 AddTask第一个窗口将AddTask.aspx作为带有组合框和文本框的加载器,Search第二个窗口将Search.aspx作为带有gridpanel的加载器。
我想使用javascript从搜索窗口访问AddTask窗口中的文本框
我能够使用parent.Ext.getCmp(从搜索中捕获AddTask窗口AddTask );但是如何在AddTask中访问文本框?
Default.aspx:
I have 1 page that has 2 windows with loaders. AddTask first window has AddTask.aspx as loader with comboboxes and textboxes and Search second window has Search.aspx as loader with a gridpanel.
I want to access a textbox in AddTask window from Search window using javascript
I am able to catch tho AddTask Window from the search using "parent.Ext.getCmp("AddTask");" but how I can access the textbox in AddTask??
Default.aspx:
var createWindow = function () {
parent.Ext.create("Ext.window.Window", {
title: "اضافة المهمة",
titleAlign: 'right',
id: 'AddTask',
width: 500,
height: 600,
closeAction: 'destroy',
loader: {
url: "AddTask.aspx",
loadMask: { showMask: true },
autoload: true,
renderer: 'frame'
}
}).show();
};
<ext:Window
ID="Window1"
runat="server"
Closable="false"
Resizable="false"
Draggable="false"
Modal="true"
Layout="Form" Border="false" Header="False" Maximized="True" >
<Items>
<ext:TabPanel runat="server" ID="TabPanel1" Border="false">
<Plugins>
<ext:TabScrollerMenu PageSize="10"/>
</Plugins>
<DirectEvents>
<TabChange />
</DirectEvents>
</ext:TabPanel>
</Items>
<DockedItems>
<ext:Toolbar ID="Toolbar1" runat="server" Layout="Container" Width="25" Flat="true" Dock="Right">
<Items>
<ext:Button ID="Button1" runat="server" Icon="Accept" RenderTo="Toolbar1" AutoRender="true">
<DirectEvents>
<Click />
</DirectEvents>
</ext:Button>
<ext:Button ID="Button2" runat="server" Icon="Add" Handler="createWindow"/>
<ext:Button ID="Button3" runat="server" Icon="Application"/>
<ext:Button ID="Button4" runat="server" Icon="Bell" />
<ext:Button ID="Button5" runat="server" Icon="Bomb" />
</Items>
</ext:Toolbar>
</DockedItems>
</ext:Window>
AddTask.aspx:
AddTask.aspx:
var createWindow = function () {
var num = Ext.getCmp("numtext").getValue();
parent.Ext.create("Ext.window.Window", {
title: "نتائج البحث",
titleAlign: 'right',
width: 700,
height: 300,
closeAction: 'destroy',
loader: {
url: "Search.aspx",
loadMask: { showMask: true },
autoload: true,
renderer: 'frame',
params: {
'num': num,
'flag': 'Like'
}
}
}).show();
};
<td>
<ext:Button runat="server" ID="search" Text="بحث تقريبي" Handler="createWindow" >
</ext:Button>
</td>
Search.aspx:
Search.aspx:
function test() {
var win = parent.Ext.getCmp("AddTask");
}
<ext:Button runat="server" ID="button1" Handler="test()" Text="test parent direct" />
推荐答案
这篇关于如何在ext.net中访问窗口的组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!