Third Party Development

Important: This feature requires a strong understanding of Javascript to use properly.

Filterable Sortable Data Lists provide Javascript events the developers can listen for to add their own processing at different points in the process of generating and interacting with the FSDL by a user.

FilterableDataList Class

Under the UAlberta Javascript object there is a class called FilterableDataList. This contains all of the functionality for FSDLs.

Within the FilterableDataList Class there is a function and another class:

  • Initialize: This is the function that is used to create the FSDL on the page when the page has finished loading.
  • Events: This is the FSDL Event class that contains all of the event-related functionality for other developers to use, and the focus of this page.

The event class has two members, an object of available event types and a function to register to an event. The details of each of these is described in more detail below.

Event Types

All event type references are found under the Types object that is apart of the UAlberta.FilterableDataList.Events class.

Below is a list of all of the event types that are available, when they trigger and the parameters it passes to the callback function.

Event When it Triggers Parameters Passed
OnDataLoadSuccessPreProcess Triggers when the data list data has successfully loaded but before any processing is done on it

Passes in an event object. The event.details contains the data list data that was loaded. Changes to this data are reflected in the rest of the application.

OnDataLoadSuccessPostProcess Triggers when the data list data has successfully loaded and after all processing is done on it. Passes in an event object. The event.details contains the data list data that was loaded. Changes to this data are reflected in the rest of the application.
OnDataRefine Triggers after the data list data has been refined down to a subset due to a filter being applied or search being performed. Passes in an event object. The event.details contains the refined data.
OnDetailsPagePreDisplay Triggers when the details page is loaded but before any information is displayed on the page. Changes to this data are reflected in the rest of the application. Passes in an event object. The event.details contains no data.
OnDetailsPagePostDisplay Triggers when the details page is loaded after the information is displayed on the page. Passes in an event object. The event.details contains no data.
OnTableDisplay Triggers after the data list table has been displayed on the page. Passes in an event object. The event.details contains no data.
OnTableSort Triggers after the data list table has been sorted by a specific column. Passes in an event object. The event.details contains no data.
OnPaginationChange Triggers after the pagination page has been changed and the new results have been displayed on the page. Passes in an event object. The event.details contains the page index that was selected.
OnFilterAdd Triggers after a filter has been displayed on the page. Passes in an event object. The event.details contains the filters configuration. Changes to the configuration are reflected in the rest of the application.
OnFilterChange Triggers after a filter has changed. Passes in an event object. The event.details contains the values for the filter. Changes to the values are reflected in the rest of the application.

Registering To Events

To register to an event you must call the Register function that is a part of the UAlberta.FilterableDataList.Events class.

Register Function

UAlberta.FilterableDataList.Events.Register(string eventType , function caller )
eventType

This is a reference to the different Event Types available as mentioned above.

caller

This is the function that will be called when this event is triggered. The parameters this function takes are dependent on the event that is triggered.

An example of registering to an event. When the data is loaded but before it is processed, we add a new row of data to the results.


UAlberta.FilterableDataList.Events.Register(
    UAlberta.FilterableDataList.Events.Types.OnDataLoadSuccessPreProcess,
    function(e) {
        if (e && e.details) {
		    e.details.push([["This"], ["is"], ["a"], ["new"], ["row"]]);
        }
    }
);