Show contents 

Example of Creating the EaxGrid Component

Example of Creating the EaxGrid Component

To execute the example, create an HTML page and add links to the following JS and CSS file in the <head> tag:

The repository must also contain an express report with the 66676 key.

In the <body> tag specify name of the function to be executed after page body has been loaded, as a value of the onLoad attribute:

<body onload="Ready()"> 
	<div id="eaxGrid" style="float: left"></div>
</body>

Add the following script in the <head> tag:

	PP.ImagePath = "../Build/img/"; // Path to images folder
	PP.ScriptPath = "../Build/"; // Path to scenarios folder
	PP.CSSPath = "../Build/"; // Path to style files folder
	// Specify path to the root folder with resources files
	PP.resourceManager.setRootResourcesFolder("../Resources/");
	// Determine regional settings
	PP.setCurrentCulture(PP.Cultures.ru);
	function Ready() {
		var waiter = new PP.Ui.Waiter();
		// Create a repository connection
		metabase = new PP.Mb.Metabase({
			PPServiceUrl: "PPService.axd?action=proxy",
			Id: "warehouse",
			UserCreds: {
				UserName: "sa",
				Password: "Qwerty1"
			},
			StartRequest: function () {
				// Display the component of the PP.Ui.Waiter type on metadata request
				waiter.show();
			},
			EndRequest: function () {
				// After executing the request hide the component of the PP.Ui.Waiter type
				waiter.hide();
			},
			Error: function (sender, args) {
				// In case of error, display error description
				alert(args.ResponseText);
			}
		});
		// Open repository connection
		metabase.open();
		// Create a service for working with express reports
		eaxMdService = new PP.Exp.EaxMdService({
			Metabase: metabase
		});
		// Open express report with the 66676 for edit
		eaxAnalyzer = eaxMdService.openDocument(66676);
		// Create a table
		eaxGrid = new PP.Exp.Ui.EaxGrid({
			Source: eaxAnalyzer, // Data source
			ParentNode: "eaxGrid",
			Service: eaxMdService, // Service
		});
	};

After executing the example the EaxGrid component is placed on the HTML page.

See also:

EaxGrid