mbertoldi schrieb:
> On 1 Apr, 09:31, apm <[EMAIL PROTECTED]> wrote:
>> Hi all
>>
>> I have been looking around for a (Tosca)Widget to use dojo [1] with
>> TurboGears. Has somebody made such a thing or could you give me some
>> hints on using dojo with TG? Apart from ajax, I am particulalry
>> interested in using dojox graphics (gxf) and cometd.
>>
> there isn't a Widget version of Dojo,
> but if you download the latest version and put dojo,dijit and dojox
> folder in the static/javascript subfolder of your project
> you can use:
> 
> <script type="text/javascript" src="${tg.url('/static/javascript/dojo/
> dojo.js')}" djConfig="isDebug: false, parseOnLoad: true"></script>
> 
> in your master.kid (or master.html using genshi) to load the dojo
> toolkit in all your pages.

While this works, I would advise you to build a widget wrapper for Dojo, 
since this will:

- Allow others to install the widget with easy_install
- make it unnecessary for them to include Dojo in their project
- allow widgets, which rely on Dojo, to just add the Dojo widget to 
their "javascript" attribute and it will be automatically included in 
the page

Look at this page in the wiki, to see how to use widgets with JS and CSS 
(it is targeted at TG widgets but the same principle applies to TW):

     http://docs.turbogears.org/1.0/WidgetsWithJSAndCSS

To build a Dojo widget wrapper, start a TG project with the "-t 
tgwidget" option and then have a look at the Scriptaculous widget to see 
how to structure your project. A TW widget wrapper should be similar, 
but I don't have much experience with this, you have to ask other for this.

     http://trac.turbogears.org/browser/widgets/Scriptaculous/trunk


>>  What would be the benefit of using a widget or not,
>> after all?

See above.

Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to