[Dojo-interest] Help with Button
Dustin Machi
dmachi at dojotoolkit.org
Sun Dec 16 19:26:19 UTC 2007
I made an example for you here:
http://dojotoolkit.org/~dmachi/examples/ButtonExamples.html
Dustin
Daniel wrote:
> Read the documentation:
>
> http://theingots.org/Ajax-tests/Dojo/Markbook.html
>
> I can't get a button. I'm trying to make reasonable guesses based on the
> markup-based example as to how a programmatic example would look like:
>
> var button = document.createElement("button");
> button.setAttribute('type', 'submit');
> button.innerHTML = 'OK';
> button = dijit.form.Button({onclick: 'alert("Hello");'},button);
>
> I've tried many variations of this:
> - Empty parameters.
> - String parameter for onclick.
> - Anonymous function parameter for onclick.
> - With or without 'setAttribute'.
> - With or without innerHTML...
>
> I keep getting the same error:
>
> dojo.js (line 1546)
> this._construct is not a function
> [Break on this error] return function(){ this._construct(arguments); }
>
>
> The context in dojo.js is:
>
> _makeCtor: function(){
> // we have to make a function, but don't want to close over anything
> return function(){ this._construct(arguments); }
> },
>
>
> :-(
>
> Could someone tell me how to create a button programmatically?
>
> Thanks,
> Daniel.
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
More information about the Dojo-interest
mailing list