javascript - Dojo widget defaults -


I am currently writing applications on a large scale based on the Dojo Toolkit. The whole app is working and standing, but one issue can not get my way, it is the creation of custom widgets. This will be useful because it will clear my source code and I can reuse 'widgets' in the subsequent projects. For example: I have a main toolbar that I want to call

  myapp.toolbar = new myapp.mainToolbar (); Instead of using  

  myapp.toolbar = new new dijit.Toolbar ({}, container id); Var button 1 = new dijit.form.Button ({label: 'delete', id: 'toolbar button 1', Showbail: true, icon class: "DigitEditor Icon Deguit Editor Icon Delete"}); Myapp.toolbar.addChild (Button1); ...  

In short: How do I set the entire toolbar elsewhere and call it as a simple object? Trying to exclude dojo.declare ('myapp.mainToolbar', dijit.Toolbar, {...}) but then I have a group of errors like 'startup function not existing' etc. Get it ...

Although I do all this as programmatically, without a template HTML and CSS files in a custom widget,

A good tutorial or a link to howto would be nice, Google nor Yahoo! Any additional details on this matter are revealed to me ... :)

Many of this There are ways.

The extension toolbar (not sure why he did not do this) looks like the way it should work.

You can also declare a class that embeds the toolbar and buttons, using widgetsInTemplate:

  dojo.declare ("MyToolbar", [dijit._Widget , Dijit._Templated], {_widgetsInTemplate: true, templateString: '
gt; & lt; div dojoType = dijit.Toolbar & gt;' + '. Button; dojoType = dijit.form.Button. Note that the top node in the MyToolbar can not be a dojoType, so I put the toolbar a lower level

Alternatively you can use the same by using the same Talk, see, interpret.


Comments

Popular posts from this blog

email - PHP mail error ... failed to open stream : permission denied -

c# - ListView onScroll event -

c - Linux mmap() error -