A
A
Alexey Ukolov2015-03-12 09:12:25
backbone.js
Alexey Ukolov, 2015-03-12 09:12:25

How to make the view work in the background?

In my application, there is a component that is used all over the place - an object icon.
This icon itself is quite complicated - it displays the name of the object and some of its other properties. When you hover over the icon, a large window pops up with information about the object, when you right-click, the context menu opens, etc.
There are about 1000 objects, the collection with them is stored in the application's shared memory and transferred to the modules that work with it. From time to time, objects receive updates of their parameters from the server, at which point the icon should be updated.
Since the icon in all modules is displayed in the same way, I would like to render them once at the start of the application, attach the required functionality and put them in some kind of storage. And already inside specific modules, insert the view of the necessary objects.
Is it possible to implement such a system? I can’t even imagine it conceptually, so I don’t know which way to dig in search of a solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aen, 2015-03-12
@aen

This is not done at the backbone or marionette level, but at the DOM and jQuery level.
Take a look at jQuery's .detach() method, it will let you do what you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question