Examples

1. Set a filter (f="\gender.a=1") to a component with id "id1" and reload the component 

miReportApp.setComponentProperty("id1", "f", "\\gender.a=1"); <br>miReportApp.reloadComponent("id1");

2. Set dataonly = true to two components, reload the components and get JSON data after successful responses 

$(window).on("miEventComponentLoaded", function(e, id, success, dataonly) {
	<br>
	if (success && dataonly) {
	var data = miReportApp.getSavedJsonData(id);
	if (id === "id1") {
		// Do something with the data...
		// Get corresponding DOM object:
		var element = miReportApp. getComponentFromId();
		// Do something with $(element)...
	}
	else if (id === "id2") {
		//... 
	}
} });
miReportApp.setComponentDataOnly("id1", true);
miReportApp.setComponentDataOnly("id2", true);
// Clear corresponding DOM objects here and/or toggle loading classes...
// ...
// Reload
miReportApp.reloadComponents(["id1", "id2"]);

3. Get Highcharts chart object from a component with id "id1"

var hchart = miReportApp.getComponentFromId("id1").highcharts();

4. Get page with id "p1"

var page = miReportApp.getPageFromId("p1");

5. Get the last page

var page = miReportApp.getPageFromIndex(miReportApp.getPageCount() – 1);

6. Customizations 

// Change title and url icon 
miReportApp.setAppTitle("CompanyX Report"); 
miReportApp.setFavicon("https://companyx.com/favicon.png");