[EMAIL PROTECTED] a écrit :

I would say that depends on how you see the apps. I have adopted the
ajax/sorted table in  MochiKit into some form of "widget" but it sits
in its own js file and got included in the template. I use Kid to
populate an ordinary table with specific class/mochi attribute which is
parsed by the ajax table code.

Agree depends of context, I used the same approach for simple widget and widget 
used once.
My suggestion is about creating libraries of widgets easily "sharable" and 
"integrable".

About the sortable table, I create a widget. So when I need it, I only define the list of columns, the function from where cell are pull by the widget (python code) and in the template a simple "grid.insert(data)"

One of the advangtages of having loop over data in python is when you need to 
debug (sometime difficult with Kid ;-) )
Other advantages if you want to change the implementation (eg dojo to mochikit) only the widget class need to be updated (may be with adding optionnals paratemers to __init__) instead of every html page (change <script>...)

IMHO, the power of TG is to provide the both way, and to permit mix

I prefer to do it this way as I can work on them seperately, decoupling
the HTML/js stuff from python stuff, as much as possible.

The controller is the link between Model/Data and View.
I prefer having :
* low code/logic in html view
* tools for debugging/ajust code (business and display logic)

It also has the advantage that the js can be cached by the browser.

Widget also provide this feature for static js and css.

And
one day, I might swap in things from dojo or other js only stuff.

cf previous sentence

--
--------------------------------------------------------------
David "Dwayne" Bernard            Freelance Developer
                                  mailto:[EMAIL PROTECTED]
      \|/                         http://dwayne.java-fan.com
--o0O @.@ O0o-------------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to