marc
unread,May 19, 2012, 10:01:11 AM5/19/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Sammy.js
Hi,
I have a main template, that has multiple div containers, which should
be used by Sammy.js. E.g.
<div id="newsletter"></div>
<div id="content"></div>
Now I'd like to be able to have two Sammy.js "controllers", that are
bound to each of the div elements. For e.g. the newsletter div should
display a subscribe form. The form should point and be handled by the
newsletter controller. The content controller should display content,
retrieved from templates.
My first attempt was a main Sammy.js app, bound to #content. Then I've
added a Sammy.js plugin for the newsletter and included it in the main
app via this.use(App.Newsletter). The newsletter plugin had a
this.element_selector = "#newsletter" at the beginning. My problem now
is, that the content, which should be rendered to #content is rendered
to #newsletter. Another problem is, that form submits that are not in
the main element, are not captured.
What is the best approach to build an app that binds to multiple
areas?
Thanks in advance and keep the great work up. Sammy.js is so much more
smooth than backbone.js.
Marc
P.S. Sorry For the missing code samples, but it's a PITA to write code
on the iPad :)