【发布时间】:2012-04-26 07:44:53
【问题描述】:
这是我的代码
var dlg = $("#transfer_client").dialog({
dialogClass: "templateDialog",
autoOpen: false,
modal: true,
zIndex: 1500,
height: 200,
width: 200,
title: "Transfer Campaign to a different Client"
});
dlg.parent().appendTo(jQuery("form:first"));
其中 transfer_client 是 div 代码是:
<div id="transfer_client" class="dialog position" title="Transfer to a different Client">
<span>Client:</span>
<asp:DropDownList runat="server" Height="30px" ID="ddlClients" DataTextField="ClientName"
DataValueField="ClientID">
</asp:DropDownList>
<br />
<br />
<asp:Button runat="server" OnClientClick="return confirmSubmit();" ID="btnTranfer"
Text="Transfer" OnClick="btnTranfer_Click" />
</div>
我在dlg.parent().appendTo(jQuery("form:first")); 之后尝试过$("#dropDownID").chosen()
或之前,但它不会使其可搜索。但是在没有任何对话框的情况下使用代码可以正常工作。知道如何让它在对话框中工作吗?
编辑:标记为已解决,因为这是对话框 js 中的一个错误。
【问题讨论】:
-
dialog() 不是标准 jQuery 的一部分。您必须使用某种插件,或者自己编写(扩展),关心共享 dialog() 的代码?
-
我使用对话框作为docs.jquery.com/UI/Dialog
标签: jquery jquery-ui dialog jquery-chosen