[ 2 posts ]

ispyinternet

  • Joined: Thu Jul 08, 2010 5:28 am
  • Posts: 111
  • Offline
  • Profile
Tags:

Y.View / Y.Handlebars question

Post Posted: Thu Mar 29, 2012 4:05 am
+0-
I am using Y.View with Y.Handlebars to render a ModelList...

when a small amount of renderable data in that view (say a 'total' figure in one of the Models in the ModelList) were to change, I am looking for the best way to code this. Would I need to call render on the whole view (which iterates over the template for each Model in the ModelList), or can I have some sort of subviews or nested view?

I know I can target the DOM, but I am wondering if I can continue the approach in this view / template model.

I was looking at Partials in handlebars but I don't think they provide any solution to this scenario??

Any guidance would be appreciated.

Thanks.

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile

Re: Y.View / Y.Handlebars question

Post Posted: Tue Apr 17, 2012 11:56 am
+0-
If your models are fairly simple, then I'd stick with one view which represents the whole list. Here's an example of how to set this up:
http://jsfiddle.net/ericf/suqCq/

If your models are complex, then you may want to go the route of having a view for each model nested in parent view that represents the list.

I hope that helps get you started.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum