WbkSaveDataDialog Constructor

Syntax

PP.TS.Ui.WbkSaveDataDialog  (settings);

Parameters

settings. JSON object that contains values of component properties.

Description

The WbkSaveDataDialog constructor creates an instance of the WbkSaveDataDialog class.

Example

To execute the example, in the Head tag of the HTML page specify links to the following JS and CSS files:

In the <body> tag as the value of the onLoad attribute specify name of the function executed after page body loading is finished:

<body onselectstart="return false" class="PPNoSelect" style="margin: 0px">
	<input type="button" value="save data" onclick="openDialog();" />
</body>

At the end of the document insert code to set styles to the document.body node, corresponding to the client's OS:

In the SCRIPT tag add the following script:

<script type="text/javascript">
	// Determine language settings for resources
	PP.setCurrentCulture(PP.Cultures.ru);	
	//Function for getting handlers' functions
	/Gets additional information as a parameter that is displayed in the console on calling a handler.
	//This may be, for example, a string containing event class name
	function onDummyActionFactory(actionCaption){
		return function (sender, args){
			console.log(actionCaption);
			console.log(sender);
			console.log(args);
		};
	}
	function openDialog() { //button click event handler
		//function of clicking the OK button event in the dialog
		function onWbkSaveDataDialogOkButtonClick(sender, args)
			{
				var newDlg = sender; // Dialog for adding a revision marker
				var comment = newDlg.getComment();
				console.log("comment: " + comment + "\n");
			}
		// Create an instance of the class that implements a save dialog
		var wbkSaveDataDialog =  new PP.TS.Ui.WbkSaveDataDialog({
			ResourceKey: "WbkSaveDialog",
			OkButtonClicked: PP.Delegate(onWbkSaveDataDialogOkButtonClick, this),
			CancelButtonClicked: PP.Delegate(onDummyActionFactory("wbkSaveDialogCancelClicked"), this),
			Closed: PP.Delegate(onDummyActionFactory("wbkSaveDialogClosed"), this)
		});
		// Display dialog
		wbkSaveDataDialog.show();
	};
</script>

After executing the example the Save Data button is placed on the HTML page. Clicking this button opens a dialog box to create a comment:

See also:

WbkSaveDataDialog