"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
writes:
> What I'm thinking is, that I can build an app - statically if you like,
> no ajax - All is good, I use TableForms. Now I want to do something a
> bit fancy, override a link so that on click it does some lovely
> scriptaculas slidey thing to reveal a form, but that would mean
> statically recreating the form using MochiKit DOM.
I do that. The only thing I missed is an option to eliminate the action
attribute and the submit button. You can add JavaScript to widgets by using,
e.g., the attrs attribute:
================================================================================
widgets.Button(attrs =
dict(onclick="monta_tabela_curva_calibracao(getElement('form_fieldset_pontos_curva'))",
value = lazy_gettext(u"Criar tabela de calibração"),
),)
================================================================================
This is one widget of mine calling a JavaScript function and using MochiKit's
DOM function "getElement".
> I just thought it would be cool to be able to include a dynamic JS file
> that was created right from a form schema. Of course it depends how you
> build the app, you could indeed just render the form to the page as
> normal and play with it via javascript. It's just if default behaviour
> was to go to a new page for the form and ajax behaviour was to show it
> dynamically ...
You can add JavaScript to widgets. And if you want you can derive a new class
and just add the JavaScript part to load some specific file. There's no need
to change the template. But even then you'd have to add your JavaScript code
to widgets.
> Like I said, just a thought, not a serious proposition. Your getting
> into the realms of python-converted-to-javascript I suppose ...
:-)
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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-trunk
-~----------~----~----~----~------~----~------~--~---