backbone.js - How do I leverage Marionette to rerender a nested CompositeView after a child's model is destroyed? -
I thought that Marianaut will automatically remove the ideas of deleted models but it is not working in my situation . I have a holistic view that displays the collection of movies. Each film has a list of actors. When I click on "delete movie", then it should remove all the associated actors and update the scene of that special movie that was deleted. Currently, my application destroys the model but the view has not been updated. If I refresh the page, then the movie and related actors have gone, so I know that it is destroying the model, just the thoughts of that moment have been clicked not only.
Relevant control code: Here is my view code: I do not completely see what you can achieve , But if you want to update ideas after destroying a model: It believes that your recipes are either a collection of ListView - or a holistic view also: I use an overall view and through events A bella has also been created to remove an item: If the above does not help you, you can explain:
list.movie = marriott Composite view. Extension ({tag name: "li", template: "# actor- movie-list-item", see item: list. Author, start: function () {console.log ("actor:", this.model.actors) ; Actors = this.model.actors; this.collection = artist; this .collection = new backbone.collection (actor);}, Event: {"click on a.js-remove-movie": "Deleted Deleted "}, Delete deleted: function (e) {e.preventDefault (); e.stopPropagation (); this.trigger (" movie: delete ", this.model);}, appendHtml: function (see archive, item view , Index) {var container; container = this. $ ('Recipe-list'); Container.exe (itemView.el);}, renderer: function () (if (_. Uidffield (this cipher)) {it. $ ("Ul: first"). Remove ();} console.log (" );}});
Recipes LISTView.on ("Item View: Movie: Delete", function (childView) ) {// This removes a model from recipes Planet .collection.remove (childView.model);});
- In list.view, < What is code> this.model.actors ?
- How your ideas are structured (see nesting type) - How is your data defined in models and collections?
Comments
Post a Comment