ValidationCatView.getExplainButton

Syntax

getExplainButton();

Description

The getExplainButton method returns the Explain button in the Validation tab of the workbook ribbon.

Comments

This method returns an object of the PP.Ui.RibbonButton type.

Clicking this button displays the dialog box to enter text that explains the selected validation error.

Example

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and a table must be loaded to workbook data area. A validation rule that finds at least two invalid values must be executed:

Explain the last validation error:

// Get workbook tool ribbon
var ribbon = workbookBox.getRibbonView();
// Get the Validation tab
var validationCategory = ribbon.getValidationCategory();
// Display and open the tab
validationCategory.setIsHiddenActive(True)
ribbon.refreshAll();
// Get the Last Error button
var lastErrorButton = validationCategory.getLastErrorButton();
// Imitate the button click
lastErrorButton.Click.fire(lastErrorButton);
// Get the Explain button
var explainButton = validationCategory.getExplainButton();
// Imitate the button click
explainButton.Click.fire(explainButton);

After executing the scenario the cell corresponding to the last validation error is selected, and the Explain Validation Error dialog box opens:

 

Type in the text "Calculation error" in the dialog box and click OK. After this the last validation error is considered as explained, and the corresponding cell has a comment with the text that appears on mouse over:

Then explain the error next to last:

// Get the Previous Error button
var previousErrorButton = validationCategory.getPreviousErrorButton();
// Call button click event
previousErrorButton.Click.fire(previousErrorButton);
// Explain this error
validationCategory.setExplanation("Error in dimensions");

After executing the example appears a dialog box with the text "Error in measurements". After clicking the OK button the error next to last is marked as explained (just as in case with the last error).

Then hide all the explained errors:

// Get the Hide Explained button
var hideExplanationButton = validationCategory.getHideExplanationButton();
// Display the button as pressed
hideExplanationButton.setIsPressed(True);
// Imitate the button click
hideExplanationButton.Click.fire(hideExplanationButton);
// Display the button as released
hideExplanationButton.setIsPressed(False);

After the scenario execution all explained errors are hidden:

See also:

ValidationCatView