如果窗口有Visible="false"
,我该如何显示?
<ext:Window ID="WndwLinkDoc" runat="server"
Width="650" Height="350" CloseAction="Hide"
X="120" Y="120" Visible="false" Title="Link doc"
ConstrainHeader="true"
Layout="FitLayout">
我试过了
WndwLinkDoc.Show()
但它不起作用。
如果我使用Hidden="true"
,我在访问此内容时遇到问题:
<ext:Hidden runat="server" ID="hdnclid" />
通过将其值传递给参数:
来存储在窗口中<ExtraParams>
<ext:Parameter Name="clientid" Value="#{hdnclid}.value" Mode="Raw"/> //error hdnclid undefined
</ExtraParams>
完整的窗口代码:
<ext:Hidden runat="server" ID="hdnclid" />
<ext:Window ID="WndwLinkDoc" runat="server"
Width="650" Height="350" CloseAction="Hide"
X="120" Y="120" Visible="false" Title="Link doc"
ConstrainHeader="true"
Layout="FitLayout">
<Items>
<ext:ComboBox ID="CmbFindDoc" runat="server"
DisplayField="FullName"
ValueField="id"
TypeAhead="true"
FieldLabel="Doctor"
Width="470" MaxLength="150"
PageSize="10" AllowBlank="false"
LabelWidth="130" ForceSelection="true"
HideTrigger="false"
MinChars="0"
TriggerAction="Query">
<ListConfig ID="lstc" LoadingText="Searching...">
<ItemTpl runat="server">
<Html>
<div class="search-item">
<h3>{DocTitle} {FullName}</h3>
{Speciality1}, {Address} - {City}   {Phone} {Mobile} {Email}
</div>
</html>
</ItemTpl>
</ListConfig>
<Store>
<ext:Store ID="storeDocSearch" runat="server" AutoLoad="false">
<Proxy>
<ext:AjaxProxy Url="/SearchControls/DoctorSearch.ashx">
<ActionMethods Read="POST" />
<Reader>
<ext:JsonReader RootProperty="Doc" TotalProperty="total" />
</Reader>
<ExtraParams>
<ext:Parameter Name="clientid" Value="#{hdnclid}.value" Mode="Raw"/>
</ExtraParams>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model ID="mdl" runat="server">
<Fields>
<ext:ModelField Name="id" Type="Int" />
<ext:ModelField Name="FullName" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
<ext:Button runat="server" Text="Link doc" >
</ext:Button>
</Items>
</ext:Window>
答案 0 :(得分:0)
<ext:Window ID="WndwLinkDoc" runat="server"
Width="650" Height="350" CloseAction="Hide"
X="120" Y="120" **Hidden="true"** Title="Link doc"
ConstrainHeader="true"
Layout="FitLayout">
你可以使用代码隐藏;
WndwLinkDoc.Hide();
WndwLinkDoc.Show();
答案 1 :(得分:0)
据我所知,你想在Code Behind的DirectEvent中显示这个窗口,对吧?在这种情况下,在将Visible标志设置为true之前,必须使用Render方法。这是一个有效的例子:
*。ASPX
<ext:ResourceManager runat="server" />
<ext:Window runat="server" ID="myWindow" Visible="false" Title="Window Test" />
<ext:Button runat="server" Text="Show Window">
<DirectEvents>
<Click OnEvent="Button_Click" />
</DirectEvents>
</ext:Button>
*。aspx.cs
protected void Button_Click(object sender, DirectEventArgs e)
{
if (!myWindow.Visible)
{
myWindow.Visible = true;
myWindow.Render();
}
}