When I close the dialog, I want a list element to be made on the fly. When the list element is clicked, the dialog is opened again. Is this possible?
$('#dialog').dialog({
close: function() {
var e = $(this).parent().find('.ui-dialog-title').text();
var id = $(this).attr("id");
$('li',
{
class: id,
value: e,
click: function(){
$('#'+id).dialog('open');
}
}).appendTo('#aULelement');
},
open: function() {
var id = $(this).attr("id");
if ($('.'+id).length){
$('.'+id).remove();
}
}
});
As of now, this code does not build a list item but returns no error.
You were close. You need to use
<li/>andtextorhtmlinstead ofvalue:Example:
http://jsfiddle.net/jtbowden/BGLxW/