Repcombinator for DHIS2
How do i start Repcombinating?
Take the Repcombinator.js
file and include it in your html page.
A repcombinator that is created by the Repcombinator
object on the window will allow you to load and render tables.
Creating the repcombinator instance
First we'll create one of those:
const repcombinator = ;
Option | Default | Description |
---|---|---|
apiUrl |
../api |
Optional api url if you're not working against the same server, user it in a node script, or the api is not located at ../api |
render |
{} |
Placeholder for future render options. |
Additionally any other options will be used as Request init options.
Loading and rendering tables
From there we can ask for reports to combine by providing an array of valid UIDs.
repcombinator // Load reports and combine them into a single report object ;
CDN
IE10+ Compatibility
To make it work on IE we'll need to add a fetch
and a Promise
polyfill.
https://github.com/github/fetch#installation