19

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

1
  • Why add $ in front of JavaScript variable? Commented Sep 6, 2018 at 12:32

2 Answers 2

35

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.

Sign up to request clarification or add additional context in comments.

Comments

8
$('#dialog ID').html('SOME CONTENT');

1 Comment

sorry, didn't get the id part, i'm posting my init code...10x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.