Is it possible to add icons to the buttons on a jQuery UI Dialog? I\'ve tried doing it this way:
$(\"#DeleteDialog\").dialog({
resizable: false,
hei
How about a class-based approach?
In your _layout.cshtml file put something like the following:
Then, in the file where you are creating the dialog, do something like this:
$("#doStuff-dialog").dialog({
title: "Do Some Stuff",
modal: true,
buttons: [
{
text: "Yes",
class: "my-button-submit",
click: function () {
$(this).dialog("close");
}
},
{
text: "No",
class: "my-button-cancel",
click: function () {
$(this).dialog("close");
}
}
],
open: function () {
stylizeButtons($("#doStuff-dialog").parent());
}
});
Then you never have to rely on searching for text, and it requires a minimal amount of code in your dialog. I use this throughout my applications to apply jquery UI styling/icons to buttons just by giving them a class.