Hello everyone,
First off I apologize if this comes accros as being a dull set of questions but I figured I was better off asking people with experience before diving into documentations. It might turn out that my usage case might not work completely or would need rethinking.
I’m working on upgrading one of our webapps. Some aspects could benifit greatly from using Ember so here’s a quick description of what I’m looking at:
Idealy I would like to have a single page load and then any extra content displayed would be dynamically loaded from the servers via ajax calls. The application contains dozens of different pages with different content for different uses. The complexity of each page varies, and to this will be added a number of “modules” that have their own set of pages within the application layout (partial view renders). Modules are loaded (or removed) by the administrator during runtime so they do not exist within the core application.
The web app server side scripting uses an MVC framework that will handle all user rights/roles and content logic (filtering,scoping,etc.).
With this in mind here are my questions:
-
From reading documentation and checking videos, it seems like all HTML for the webapplication needs to be loaded initialy. I have found that you can use JQuery .ajax() along with Ember.TEMPLATES but is that the only option? I’d obviously be interrested in loading HTML content (or in this case “text/x-handlebars” content) on link click or preloading a single depth of links.
-
If that is the only option then is it also possible to dynamically load ember code along with these templates? or does all application javascript have to reside in the initial load? An example would be if I used ember for the page layout. Could I dynamicaly load nested ember scripts (with page loads inside this layout) that could interact with the layout level features. I haven’t looked into specifics but if I could load ember scripts within the main ember application I would like to know if events could bubble up and possibly down the nested scripts.
-
The server side framework comes with a number of widgets that I plan on using. One such example is pagination. Pagination reloads a content dynamically via ajax calls (either on tables or a list of elements). With this particular example navigating through pages has cons in regards to going “back” to previous pages or to the correct page in the pagination if you accessed another page afterwards. I don’t think there’s an easy solution here other than ditching this completely for an ember equivalent but this removes a lot of inbuilt filtering and sorting options the framwork provides.
All in all I’m trying to weigh pros and cons of simply making due with JQuery only or going all the way and making something fully fledged with ember.