diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f053d4b0..5fb87cee83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ Selection * Fix selection when selecting row/col/all * Add new classes in apiBuilder: ApiName, ApiComment. * Add new functions in ApiName: GetName, SetName, Delete, GetRefersTo, SetRefersTo and properties: Name, RefersTo. -* Add new functions in ApiRange: GetDefName, GetRows, Clear, GetWorksheet, GetComment and propoerties: DefName, Rows, Worksheet, Comment. +* Add new functions in ApiRange: GetDefName, GetRows, Clear, GetWorksheet, GetComment, Select and propoerties: DefName, Rows, Worksheet, Comment. * Add new functions in ApiWorksheet: GetDefNames, GetDefName, AddDefName SetActive, GetComments and propoerties: DefNames, Active, Comments. * Add new functions in Api: Intersect, GetSelection, GetDefName, AddDefName and propoerty: Selection. * Add new functions in WorkBook: addDefName, getDefinedNamesWS. diff --git a/cell/apiBuilder.js b/cell/apiBuilder.js index da866adf77..763d257ad8 100644 --- a/cell/apiBuilder.js +++ b/cell/apiBuilder.js @@ -1915,6 +1915,18 @@ } }); + /** + * Selects the object. + * @memberof ApiRange + */ + ApiRange.prototype.Select = function () { + if (this.range.worksheet.getId() === this.range.worksheet.workbook.getActiveWs().getId()) { + var newSelection = new AscCommonExcel.SelectionRange(this.range.worksheet); + newSelection.assign2(this.range.bbox); + newSelection.Select(); + } + }; + //------------------------------------------------------------------------------------------------------------------ // // ApiDrawing @@ -2510,7 +2522,8 @@ ApiRange.prototype["AddComment"] = ApiRange.prototype.AddComment; ApiRange.prototype["GetWorksheet"] = ApiRange.prototype.GetWorksheet; ApiRange.prototype["GetDefName"] = ApiRange.prototype.GetDefName; - ApiRange.prototype["GetComment"] = ApiRange.prototype.GetComment; + ApiRange.prototype["GetComment"] = ApiRange.prototype.GetComment; + ApiRange.prototype["Select"] = ApiRange.prototype.Select; ApiDrawing.prototype["GetClassType"] = ApiDrawing.prototype.GetClassType;