Selection: Object
The Selection property contains cells selected in the express report table.
Property value can be set using JSON or the setSelection method, and returned using the getSelection method.
Value of this property is an array of JSON objects with the following fields: range - selection range in the express report table, type - selection type.
Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Select a random range in express report table, next get coordinates, length and width of this range:
var eaxAnalyzer = expressBox.getSource(); // Work if cells are selected if(eaxAnalyzer.getIsSelectionChanged()) { // Get selected express report elements var selection = eaxAnalyzer.getSelection(); // Get information about the first selected area var info = selection.range.parts.it[0]; // Output coordinates of selected area console.log("Top: " + info.top); console.log("Left: " + info.left); // Output width and height of selected area console.log("Width: " + info.width); console.log("Height: " + info.height); }
After executing the example the browser console displays coordinates, length and width of the range selected in the table:
Top: 3
Left: 2
Width: 2
Height: 4
See also: