Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change jQuery dialog html content after init?

I have a working dialog, and i want to change the content during the flow of the app, I mean to change the .html() property of the dialog...

I thought it was easy to do but i can't seem to do:

$dialog.dialog().html(SOME CONTENT);

How do I do that after I already have the dialog running?

My init code is:

var $dialog = $('<div></div>')
    .html(SplitTable)
    .dialog({
        autoOpen: false,
        height: 500,
        width: 600,
        title: 'פיצול שולחן'});

    $dialog.dialog('open');

where is the ID in that? this is the what i understood i should do from the examples, didn't see any Id property...

p.s. splitTable is the content that i need to change during to program to updatTable...

10x

like image 683
Erez Avatar asked Sep 23 '10 16:09

Erez


2 Answers

Make sure that the $dialog variable is in scope where you're wanting to change the content, then just a .html() call will work, like this:

$dialog.html(updatTable);

You can see it working here.

like image 187
Nick Craver Avatar answered Oct 22 '22 15:10

Nick Craver


$('#dialog ID').html('SOME CONTENT');
like image 26
trrrrrrm Avatar answered Oct 22 '22 15:10

trrrrrrm