equals(coord: PP.Ui.TabSheetCoord);
coord. Coordinates to be compared.
The equals method checks if two coordinates are equal.
This method returns True if the compared coordinates are equal, otherwise it returns False.
To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Create new objects of table coordinates and compare them using the following parameters: equality, greater, greater or equal, less, less or equal. Check coordinates validity, parse the string to new coordinate values:
// Determine new objects of table coordinates var coord1 = new PP.Ui.TabSheetCoord(0, 0); var coord2 = new PP.Ui.TabSheetCoord(1, 1); console.log("Coordinates coord1: (" + coord1.rowIndex + "," + coord1.colIndex + ")") console.log("Coordinates coord2: (" + coord2.rowIndex + "," + coord2.colIndex + ")") console.log("Coordinates coord1 and coord2 " + (coord1.equals(coord2) ? "equal" : "not equal")); console.log("Coordinates coord1 " + (coord1.isGreaterThan(coord2) ? "greater than coordinates" : "not greater or equal to coordinates") + " coord2"); console.log("Coordinates coord1 " + (coord1.isGreaterThanOrEqualTo(coord2) ? "greater or equal to coordinates" : "not greater than coordinates") + " coord2"); console.log("Coordinates coord1 " + (coord1.isLessThan(coord2) ? "less than coordinates" : "greater or equal to coordinates") + " coord2"); console.log("Coordinates coord1 " + (coord1.isLessThanOrEqualTo(coord2) ? "less or equal than coordinates" : "greater than coordinates") + " coord2"); // Check validity of coordinates coord1 console.log("Validity of coordinates coord1: " + coord1.isValid()); // Determine a string to be parsed var coordString = "2_2"; // Parse the string to new coordinate values coord1.parse(coordString); // Output new coordinate values console.log("New coordinate values: (" + coord1.rowIndex + "," + coord1.colIndex + ")");
After executing the example the browser console shows the results of coordinates comparison, result of validity check and new coordinate values:
Coordinates coord1: (0,0)
Coordinates coord2: (1,1)
Coordinates coord1 and coord2 are not equal
Coordinates coord1 are not greater than or equal to coord2
Coordinates coord1 are not greater than coord2
Coordinates coord1 are smaller than coord2
Coordinates coord1 are smaller than or equal to coord2
Coordinates validity for coord1: True
New coordinates: (2,2)
See also: