Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing a TodoView from the DOM #3

Open
richardscarrott opened this issue Mar 28, 2013 · 3 comments
Open

Removing a TodoView from the DOM #3

richardscarrott opened this issue Mar 28, 2013 · 3 comments

Comments

@richardscarrott
Copy link

I'm not sure if this is the place to ask questions but...

I've been working through the anatomy of backbone and I'm a little confused about why, in your Todo app, you're listening to the 'remove' event within the TodoItems collection and then calling hideModel which in turn triggers a 'hide' event on the model in question at which point you remove the views el from the dom.

Did you do it that way just to demonstrate custom events or is it wrong (architecturally) to instead listen to the 'remove' event directly in the TodoView rather than going via the collection?

Cheers,
Rich

@yooosef
Copy link

yooosef commented Mar 28, 2013

Hey Rich,

Reach out to us at help.codeschool.com and we can look into this for you. Thanks!

Joseph

@renz45
Copy link

renz45 commented Mar 28, 2013

Hi Rich,
I'll take a stab at this :) , I think the reason you would do this is so that you could have this hide event listener in one spot and have the hide functionality work across the different list views this collection might be used in. It's certainly not a bad thing to do it on a per view basis, and you may have to do that depending on what you're doing in the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@richardscarrott @renz45 @yooosef and others