JQuery ui1.7 Dialog can only eject one problem _jquery

Source: Internet
Author: User
Copy Code code as follows:

Show confirmation dialog box
function Showconfirm (Txttitle, Txtmsg, callback) {
Getdivdialog (). Text (TXTMSG). Dialog ({
Modal:true
, overlay: {
opacity:0.5
}
, Title:txttitle
, buttons: {
"Yes": function () {
Callback ();
$ (This). dialog ("Close");
}
, "No": function () {
$ (This). dialog ("Close");
}
}
});
}

However, when using ui.1.7.1, the Click event for each button can only be displayed once for dialog. No words ...
There is no explanation for viewing the official document. Google has found that in ui.1.7.1 dialog must first be initialized.
In Document.ready (function () {
Initialize dialog
})
Copy Code code as follows:

$ ("#layout-confirm"). Dialog ({
Autoopen:false,
Modal:true,
Title: "Delete"
});

In the later use, there is one thing to note:
Because some dialog parameters are passed in by the variable, you must first attach the option and then open
code example:
Copy Code code as follows:

Deltext.click (function () {
$ ("#layout-confirm"). Dialog (
' option '
, ' buttons '
,{
OK: function () {
if (File.type = = 0) {
DeleteFolder (File.path);
}
else{
DeleteFile (File.path);
}
}
, Cancel: function () {
$ (This). dialog ("Close");
}
}
);
$ ("#layout-confirm"). Dialog ("Open");
});

OK, fix it ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.