-
Notifications
You must be signed in to change notification settings - Fork 57
Quickstart For Developers
This page is intended to provide developers with a list of features/functions that already exist and will help to add additional functionality into the apps. It does not cover all the core functions which are used to generate pages, handle uri manipulation, etc. Those are all well documented in quickstart.js
There is an array at app.ext.myRIA.vars.hotw which will give the 15 most recent pages, where zero is always the most recent page. An object is stored for each page giving details, such as page type, a dateObj of when it was viewed, as well as some other information (check it in firebug).
There is also a state of the world (sotw) which is a single object of what is currently in focus.
As the name implies, this will return a jquery object of an ordered lists, containing recently searched keywords. It will add a click event as well to trigger reloading the results. There is a var (app.ext.myRIA.vars.session.recentSearches) which contains this data if you want to access it directly. The zero spot in the array is the most recently searched word(s).
full path: app.ext.myRIA.u.getRecentSearchesOL();
Often times, merchants will want to link from one of their properties to another (two stores managed under the same account) and have the cart come along with the user as they move. This is possible as long as the proper linking syntax is used. We've added a function to make this easy.
The function accepts two parameters, both of which are required. url - the store to link to. ex: http://www.mystore.com/ (should always end in a slash) types - the type of store being linked to. There are two supported types at this time: vstore (legacy store - non app) or app (app based storefront).
full path: app.ext.myRIA.a.linkToStore(url,type);
<a href='#' onClick="app.ext.myRIA.u.getRecentSearchesOL('http://www.myotherdomain.com/','app'); return false;">
Visit my other domain
</a>
This will allow a category page or product page to be opened in a dialog. For category pages, this is used to display supplemental information, not nav or product list based pages. The function supports the following variables in the infoObj parameter:
- templateID (required) - The template to be used to format the content.
- navcat (required for category page) - the category safe id of the page to be viewed.
- pid (required for product pages) - the product id of the product to be viewed.
- dialog (optional - category mode only) - an object to be passed into the $.dialog() function. If not specified, defaults will be used.
- title (optional) - the title to be applied to the dialog. templateID and navcat. The navca
full path: app.ext.myRIA.a.quickView({});
To get more script (onClick events et all) out of the view, app events are being introduced. These are used heavily in the admin user interface and they are working nicely so far.
The tag looks like so: someExtension would be the name of the extension that the function resides in, and functionName would be the name of the function within the e :{} object in that extension.
The function itself accepts two parameters: element and someObject Element would be the jquery object of the element itself. In the example above, it would be the equivalent of $("button");
someObject would be dependent on what is passed into the handleAppEvents function, which runs the app event. For quickstart, this will likely be the pageInfo object.