Friday, August 7, 2009

Dialog for to show detail info



Got the JQueryUI Dialog working (for some reason this was quite a struggle for me). Clicking a spell, feat, or skill brings up a model dialog containing the full details of the selected element.

The issue was the title. The title is set on creation, and dialog doesn't get recreated on invocation(?), so you have to do some special thing to set it after initialization. In any case, here's the code:

   
content = '';
title = name;

$("#mydialog").html(content);
$('#mydialog').dialog('option', 'title', title);
$("#mydialog").dialog({
modal: true,
autoOpen: false,
title: title
});
$("#mydialog").dialog('open');

No comments: