Menu
Download Free Trial
Table of contents

ready

ready:String

[starting from version: 2.3]

It is triggered when the component’s initial configuration completed and the component is ready to receive API calls. Please note that all JS API calls are blocked until the component’s ready event is dispatched. In other words, when ready handler is called you know that the component’s creation completed and now you can use API calls.

Also, when ready is called data structure is still loading if report parameter was specified in new Flexmonster(). To retrieve information about data source structure use reportcomplete. If you want to track changes in a report object, we recommend using reportchange.

Example

How to define report from JS:

Defining a report from JS after the component is created:

var pivot = new Flexmonster({
	container: "pivotContainer",
	toolbar: true,
	ready: function () {
		var report = {
			dataSource: {
				filename: "data.csv"
			},

			options: {
				grid: {
					title: "Report set via JS API"
				}
			},

			slice: {
				rows: [
					{uniqueName: "Country"},
					{uniqueName: "[Measures]"}
				],
				columns: [
					{uniqueName: "Color"}
				],
				measures: [
					{uniqueName: "Price"}
				]
			}
		};
		pivot.setReport(report);
	}
});

Try on JSFiddle.

See also

Flexmonster
reportcomplete
reportchange