rendrjs / rendr

Render your Backbone.js apps on the client and the server, using Node.js.
MIT License
4.09k stars 312 forks source link

hardcoded IDs and rendring partials/collections? #156

Open iDVB opened 10 years ago

iDVB commented 10 years ago

My question is two parts and all around the idea that you may have an app that has more then two collections on the screen at a time and you would want to update each when they're data changes.

Consider Wunderlist... Wunderlist

There are two lists, one is the lists-of-lists (left panel) and the other is the currently selected task list (right panel).

These lists can be edited by other users and thus may change as you have the app open, you can see the new task appear.

So, as I understand, Rendr handles routes and loads them into the hardcoded #content ID HTML node.

1) Does Rendr have a way to handle an application like the above? 2) Is there a reason the content area is a hardcoded # in the Rendr core?

UPDATE - I may have just answered 2. Is this # value override-able? so each View can have its own html node target?

Cheers, D

spikebrehm commented 10 years ago

2) Is overridable. You can create your own AppView at app/views/app_view and override to your heart's desire (code).

spikebrehm commented 10 years ago

Re: 1), do you mean

a) Is Rendr able to have two separate views side-by-side, or b) Is it able to handle realtime / push updates from other users?

Re: a), yes, you can either have a main outer view which has two child views, or you could embed one of the views, like the sidebar, directly in the layout using the {{view}} helper. Re: b), you should be able to integrate into realtime tools like Socket.IO or Firebase to do this, although I don't have an example.

LMK if you need more detail.