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

extract CompositeView out of CollectionView #36

Closed
mxriverlynn opened this issue Feb 29, 2012 · 1 comment
Closed

extract CompositeView out of CollectionView #36

mxriverlynn opened this issue Feb 29, 2012 · 1 comment

Comments

@mxriverlynn
Copy link
Member

There's a high likelihood that this will end up being extended directly off CollectionView and just add a few more methods to make it work as a composite. I think the separation is necessary, though, to help avoid confusion and to help clean up the code. There's an issue in the code comments, here:

mxriverlynn@1ebbe70#commitcomment-1021855

that needs to be addressed when the extraction happens. I put in a quick hack in my own app to work around this but a good solution needs to be found. I don't think i wnat to change the way the HTML is attached. rather, I want to avoid re-rendering the ModelView when the collection is reset.

the hack i mention is to add these two lines to the top of the renderModel method in Marionette's CollectionView:

  if (this.modelViewRendered) { return; }
  this.modelViewRendered = true;

This will prevent the model view from being re-rendered when the reRender method is called. There are likely some side effects / drawbacks to this approach, and a better solution needs to be found.

@mxriverlynn
Copy link
Member Author

in the dev branch, waiting for release

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

1 participant