[ 2 posts ]

Matt Skelton

  • Username: waterloomatt
  • Joined: Mon Mar 12, 2012 10:32 pm
  • Posts: 7
  • Offline
  • Profile

YUI App Critique

Post Posted: Mon Mar 19, 2012 8:31 pm
+0-
Hi,

This is my first post on the YUI forums. I trying to learn YUI 3; specifically the App framework. I written a small app (completely useless) that switches views. It doesn't use Model. I was wondering if someone would take a look at it and give some comments if I'm doing it the right/wrong way.

http://www.mediafire.com/?kjzn6rmqlh4zz2b

Thanks,

Matt

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: YUI App Critique

Post Posted: Tue Apr 17, 2012 10:38 am
+0-
I think you have the right idea for how to start with the App Framework. There are a couple of things I noticed:

Your views have templates which are missing closing tags, you probably want to add these so the HTML is correct. Also in the render methods, you generally shouldn't have to worry about view appending itself to the body; the thing constructing the view (e.g. the app) should worry about appending the view's `container` node somewhere in the visible DOM.

The user guide for the App component has been updated with some best practices that you'll find useful:
http://yuilibrary.com/yui/docs/app/#best-practices
  [ 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