[Grok-dev] @grok.action doesn't play well with jQuery
Sebastian Ware
sebastian at urbantalk.se
Tue Mar 18 09:16:53 EDT 2008
While implementing a javascript table editor with jQuery I came across
the following problem.
@grok.action('Save')
renders html like this (using the action.render() method)
<input type="submit" id="form.actions.save"
name="form.actions.save" value="Save" class="button" />
but I can't bind jQuery events to an [id] with dots as in
[id="form.actions.save"] (it won't find the element). It works if I
exchange the dots with for example underscores
[id="form_actions_save"] giving the following html
<input type="submit" id="form_actions_save"
name="form.actions.save" value="Save" class="button" />
I am not sure why this doesn't play well with jQuery, it might be
their concept of event namespaces that also affects how they handle id.
Anyway, I really like jQuery because it has a very "grokkish" approach
to javascript (write less, do more...) so I think it would be a great
idea to change the way grok.action generates ids.
Mvh Sebastian
More information about the Grok-dev
mailing list