[Dojo-interest] How do you dynamically create TooltipDialog with execute method

Alex Russell alex at dojotoolkit.org
Sun Aug 26 19:47:24 UTC 2007

On Friday 24 August 2007 10:59 am, Chris Maxwell wrote:
> I've looked at the test examples and non of them show how to set the
> execute method dynamically. I thought I could just do like the
> example below but I get an error "this.execute is not a method"
> var dialog = new dijit.Dialog({id: "dialog1",
>         	                               title: "Change Catalog
> Pricing Period",
>         	                               execute: "alert('submitted
> w/args:\n' + dojo.toJson(arguments[0], true));"}, this.dialogNode);
> Any help would be appreciated.

execute should be a function, not a string, like this:

var dialog = new dijit.Dialog({
	id: "dialog1",
	title: "Change Catalog Pricing Period",
	execute: function(arg){
		alert('submitted w/args:\n' + dojo.toJson(arg, true));
}, this.dialogNode);


Alex Russell
alex at sitepen.com     A99F 8785 F491 D5FD 04D7 ACD9 4158 FFDF 2894 6876
alex at dojotoolkit.org BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070826/3d59baa9/attachment-0001.bin 

More information about the Dojo-interest mailing list