javascript - Best practice to cache a Marionette View -


in application developing, have collectionview every itemview contains link item-details page. also, every itemview contains checkbox, because items can selected in collectionview perform bulk actions on them.

when switching itemdetails view, want keep state of collectionview, ideally without having redraw (a bit gmail when switching inbox mail , back). our solution render 2 views in 2 different regions , hide 1 when switching 1 other.

my perplexity solution

  • marionette doesn't seem meant kind of use.
  • it not memory-friendly, since dom elements never deleted.

is there better solution achieve goal? storing state somewhere, close collectionview , redraw later possible solution, imply heavy computation overhead? (we quite scared redrawing views).

marionette allows showing view in region without closing view rendered. pass in {preventclose: true} show() method of region. still need maintain reference collection view though can later re-show or close yourself.

https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.region.md#showing-a-view


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -