Adding JS Plugins
To add your plugin to a TLV, use the JsPlugins tag in the XML. Example code:
<
TLV
>
<
Name
>ExampleTLV</
Name
>
<
Bucketization
>DAILY</
Bucketization
>
<
BucketsPerPage
>7</
BucketsPerPage
>
<
BaseTimelineViewListenerClass
>com.onenetwork.platformtestmodule.tlv.ExampleTimelineViewListener</
BaseTimelineViewListenerClass
>
<
TLVEventListenerClass
>com.onenetwork.platformtestmodule.web.ExampleTLVEventListener</
TLVEventListenerClass
>
<
JsPlugins
>PTA.ExampleTLVPlugin</
JsPlugins
>
...
</
TLV
>
You can add multiple plugins to a TLV the same way you would for a Report, using a comma-delimited list.
The next step is to create the plugin in the JS. It will just be an Object with an init function:
define(function() {
PTA.ExampleTLVPlugin = {
init: function(tlv) {
tlv.on(
'loaded'
,
this
.onLoaded,
this
);
},
onLoaded: function() {
...
}
};
});