loadSyncData(rangeArray: Array, args: Object);
rangeArray. Array of cell ranges PP.Ui.TabSheetRange.
args. Arguments to pass. Optional parameter.
The loadSyncData method sends to server a synchronous request to get a cell range.
This method returns a JSON object that contains loaded data.
To execute the example the HTML page must contain the GridBox component named grid (see Example of Creating the GridBox Component). Load and determine data of the ranges B2 and C2:
// Get table var tabSheet = grid.getTabSheet(); // Set two ranges var range1 = tabSheet.getRange(1, 2, 1, 2); var range2 = tabSheet.getRange(2, 2, 2, 2); // Get table data source var source = grid.getTableSource(); // request the server to get a cell range source.loadSyncData([range1, range2]); // Process the RangeLoaded event source.RangeLoaded.add(function (sender, args) { for (var i in args.Data) { // Get data about the loaded range var corners = args.Ranges[i].getCorners(); var range = "(" + corners.tlCoord.rowIndex + ", " + corners.tlCoord.colIndex + ")-" + "(" + corners.brCoord.rowIndex + ", " + corners.brCoord.colIndex + ")"; // Get contents of the loaded range var data = args.Data[i]; var value = data.Cells.Cell[0].CellData.FormattedText; console.log("Value in the range " + range + " is equal to " + value); } });
After executing the example the browser console displays data of the ranges B2 and C2:
Value in the range (2, 1)-(2, 1) equals to 16905,3
Value in the range (2, 2)-(2, 2) equals to 3912
See also: