ensureCurrentSelectionVisibility();
The ensureCurrentSelectionVisibility method changes visible table area to show selection.
To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Select a range, change visible area of the table in accordance with this selection, cut it, and then show range data to the browser console:
// Get a cell range by the specified coordinates
var range = tabSheet.getRange(4, 4, 5, 5);
// Select the range
range.select();
// Make sure that the selection is in the visible area
tabSheet.ensureCurrentSelectionVisibility();
// Cut the selected range contents
var cutedRange = tabSheet.cutRange();
// Request again all data source data
tabSheet.reset(tabSheet.getModel().getDataSource());
// Check if the cut data is in the clipboard
if (tabSheet.getClipboardContainsData()) {
console.log("Data is in clipboard: \r\n" + cutedRange)
} else {
console.log("No data in clipboard.")
};
After executing the example, the range (4, 4, 5, 5) is selected and placed to the visible area of the table:

Data of this range is cut and displayed to the browser console:
Data stored in the clipboard:
565 1234
232 14031
See also: