How can I add id to specific dialog? I just want to apply separate style for each dialog and try doing it like this:
var $order_dialog = $("<%= escape_javascript(render('order_mini_site_form', :layout => false)) %>");
var current_dialog = $order_dialog.dialog({
width: 515,
height: 575,
modal: true,
resizable: false,
draggable: false,
title: false,
autoOpen: true,
closeOnEscape: false,
buttons: [
{ text: "Отправить запрос" , click: function() { $(this).find('form').submit(); $(this).dialog('close'); } },
{ text: "Отмена", click: function() { $(this).dialog('close'); } }
]
}).parent().find('.ui-dialog-titlebar').remove();
$current_dialog.attr('id', 'awesome_dialog');
but dialog created inside body tag without id and I cant apply style for it.
A bit late, but this is how it could be done:
$('#placeholderId').dialog('widget').attr('id', 'dialogId');
$('#placeholderId').dialog('widget') gives you the surrounding <div> of the dialog, which is most likely the element you want to set the ID on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With