我有一个模态窗口,在下拉列表中点击一个项目时打开.按下按钮,我无法实现关闭对话框.
var $that = this;
$("#btncart_cancel").on("click", function () {
///// ***********close the dialog ***************
/// tried this but not working
$that.dialog("close");
});
Run Code Online (Sandbox Code Playgroud)
我的代码:
$(".ddlCart li").click(function (e) {
$('#actionsCart').slideToggle();
var ddlselectedVal = $(this).attr('id');
var selectedListinsCount = selected_Listings.length;
var SelectedMlsnums = selected_Listings.join();
var agentId = $("#AgentId").val();
var EnvironmentURL = $("#EnvironmentURL").val();
var autoUrl = "/Stats/SearchContacts";
var Action = "PreAddToCart"
var postData = {
AgentId: agentId,
Mlsnums: SelectedMlsnums,
ActionTypeValue: Action
};
var $that = this;
var close = function (event, ui) {
$(this).dialog("destroy");
} …Run Code Online (Sandbox Code Playgroud)