Message from JavaScript discussions

November 2016

— And so... the issue is pretty simple. Lets say I load View A with Data 1234. Then, I load View B, which overwrites all elements in the DOM. If I load View A again with 1234, it will not render.

Message permanent page


Basically I need to figure out a way to tell the view it needs to render, regardless of the diff check result

— And if you look at the componentUpdate interface, it does indeed have a force argument, so the functionality to make it render is there, just not the mechanism to detect when we need to use it

Message permanent page

— I see, how do you load views? what's your mechanism to do that?

— Load the view objects themselves?

— How do you trigger this

— Here

— > I load View B, which overwrites all elements in the DOM

— Ah, I trigger it via the usual Flux pattern of using stores and events

— That code, you can see constructs the structure of the objects, then if you look here you can see the event listener is set in the factory

Message permanent page

— So if I want to make a new ControllerView paired to the LoginPage store, I do this

controllerViewFactory("LoginPage", [viewFactory(false, procedures.renderLoginPage)])

Message permanent page

— The DOM will always contain a div called template-container, which, unless otherwise specified, is overwritten entirely by jQuery-Template

Message permanent page