Implementer Documentation

Asynchronous Load Handling

Suite has the ability to run asynchronously. You can change the content of your page and provide a new set of Custom Buttons or Widgets for it to connect to without having to reload the entire page.

Demonstration

Here is a demonstration of the Asynchronous functionality of Suite. Click one of the buttons to load a set of Suite Custom Button elements. You can swap back and forth by clicking either button and Suite will adjust.

Load Content A
Load Content B

How do we make this happen?

When Suite is loaded on page load, it scans the entire document for any elements that have a suiteQueryString attribute on them. So each time you load search results or other data, you can tell Suite to check the document again for relevant elements by calling only two functions.

1. Call drs.reset()

This will clear Suite of all prior elements that it had attached to and make it ready to recieve a new set.

2. Call drs.processSuiteElements(container)

Here, you are telling Suite to re-scan the document and attach itself to any new elements that have a suiteQueryString attribute.

Here is the code from the demonstration above in which we use the buttons to inject a set of data into a DIV with id "content" and then call the above functions to reset and process these newely added Suite elements. Don't forget to attach suite.js as well or none of this will work.