Code Monkey home page Code Monkey logo

backbone.xview's Issues

View not cleaned up

Hi,

I am planning to use your plugin for my book, and had an example working previously.

Strangely, after switching to {pushState: false} the latest DetailsView is not cleaned up, see demo: http://pipefishbook.com/ch_4/# (select a movie, and then click "home")

And the source: at https://github.com/pipefishbook/ch_4/blob/master/layout/app/views/layout.js#L17-L31

Is this is an issue with Backbone.XView ? I've the impression that it might be a zombie view, but not sure.

Thanks for your feedback!

Template engines

Hi,

I was wondering how this works with non underscore template engines.
When using a template string, it fails with:

Uncaught TypeError: Property 'template' of object [object Object] is not a function 

Maybe it would make sense to check if template is a function or not?

Zombie View creation with addView

Hi,

I am stuck with a simple looking thing.

I had 1 view added and removed dynamically to the layout:

  setDetails: function(movie) {
    if (this.currentDetails) {
      this.removeView(this.currentDetails);
      this.render();
    }
    var view = new DetailsView({model: movie});
    this.addView('#details', {id: view.cid}, view);
    this.currentDetails = view.cid;
  }

So far, and re-rendering was working great. Now, I've added a 3rd view like this:

    this.addView('#overview', new MoviesList({
      collection: options.router.movies,
      router: options.router
    }));
    this.addView('#controls', new Controls({
      collection: options.router.movies
    }));

and also tried the unwrap mode:

    Backbone.$('#controls').html((new Controls({
      collection: options.router.movies
    })).render());

Strangely, after the first adding/removing of a view in the layout, the control view becomes a zombie view. Any ideas how to debug this? That would be great, thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.