EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jwilliquor on October 11, 2012, 10:33:15 AM



Title: Change Dialog Contents
Post by: jwilliquor on October 11, 2012, 10:33:15 AM
I would like to change the contents of a dialog via a link button.  Is there a good way to change the contest of a dialog without closing the dialog and opening a new one?

Thanks
Justin


Title: Re: Change Dialog Contents
Post by: stworthy on October 11, 2012, 05:29:35 PM
The 'refresh' method can be used to change dialog content.
Code:
$('#dlg').dialog('refresh', 'new_content.html');


Title: Re: Change Dialog Contents
Post by: jwilliquor on October 11, 2012, 06:01:52 PM
I had just figured out that if I do this behind my link it works the first time.

$('#winID4').panel('open').panel('refresh','/admin/inputs/transactionsinput.html?winID=winID4&action=first');

However when I run the same bit of code following my first refresh I get the following error in firebug

Timestamp: 10/11/2012 7:49:39 PM
Error: TypeError: $.data(_1a3, "panel") is undefined
Source File: http://test.mysite.com/public/js/jquery.easyui.min.js
Line: 2054

Am I doing something wrong?


Title: Re: Change Dialog Contents
Post by: stworthy on October 11, 2012, 06:20:30 PM
If the $('#winID4') you defined is a dialog, you need to call dialog method not panel method.

Code:
$('#winID4').dialog('open').dialog('refresh','/admin/inputs/transactionsinput.html?winID=winID4&action=first');


Title: Re: Change Dialog Contents
Post by: jwilliquor on October 11, 2012, 06:28:08 PM
Thanks that solved it!!!

Justin