This topic describes the API operations that are related to the ActiveWindow of table documents.
ActiveWindow
ActiveWindow
Obtains the active window.
Syntax
expression.ActiveWindowexpression: the document type application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the active window. const activeWindow = await app.ActiveWindow; }
Properties
ActiveWindow.DisplayGridlines
By using the DisplayGridlines property, you can specify whether gridlines are displayed in the active window.
Syntax
expression.ActiveWindow.DisplayGridlines=Booleanexpression: the document type application object.
If you set
Booleantotrue, the gridlines are displayed. If you set Boolean tofalse, gridlines are hidden.Example
async function example() { await instance.ready(); const app = instance.Application; // Hide gridlines. app.ActiveWindow.DisplayGridlines = false; }
ActiveWindow.DisplayHeadings
By using the DisplayHeadings property, you can specify whether row and column headings of the active window are displayed.
Syntax
expression.ActiveWindow.DisplayHeadings=Booleanexpression: the document type application object.
If you set
Booleantotrue, row and column headings are displayed. If you set Boolean tofalse, row and column headings are hidden.Example
async function example() { await instance.ready(); const app = instance.Application; // Hide row and column headings app.ActiveWindow.DisplayHeadings = false; }
ActiveWindow.Zoom
By using the Zoom property, you can specify and obtain the display size of the active window as a percentage.
Syntax
expression.ActiveWindow.Zoomexpression: the document type application object.
Return values
Returns a Number that indicates the display size of the active window.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the display size of the active window as a percentage. The default value is 100, which indicates the normal size. const zoom = await app.ActiveWindow.Zoom; console.log(zoom); // Set the display size. app.ActiveWindow.Zoom = 10; }
ActiveWindow.ScrollColumn
You can specify and obtain the number of the leftmost column in the active window by using the ScrollColumn property.
Only JS-SDK V1.1.10 and later support this feature.
Syntax
expression.ActiveWindow.ScrollColumnexpression: the document type application object.
Return values
Returns a
Numberthat indicates the number of the leftmost column.Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the number of the leftmost column in the active windows. const ScrollColumn = await app.ActiveWindow.ScrollColumn; console.log(ScrollColumn); // Specify the number of the leftmost column in the active windows. app.ActiveWindow.ScrollColumn = 10; }
ActiveWindow.ScrollRow
By using the ScrollRow property, you can specify and obtain the number of the row that appears at the top of the active window.
Only JS-SDK V1.1.10 and later support this feature.
Syntax
expression.ActiveWindow.ScrollRowexpression: the document type application object.
Return values
Returns a
Numberthat indicates the number of the row at the top of the active window.Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the number of the row at the top of the active window. const ScrollRow = await app.ActiveWindow.ScrollRow; console.log(ScrollRow); // Specify the number of the row at the top of the active window. app.ActiveWindow.ScrollRow = 10; }
ActiveWindow.VertIndex
By using the VertIndex property, you can specify and obtain the vertical distance that the active window is scrolled.
Syntax
expression.ActiveWindow.VertIndexexpression: the document type application object.
Return values
Returns a
Numberthat indicates the vertical distance that the active window is scrolled. Unit: pixels.Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the vertical distance that the active window is scrolled. const value = await app.ActiveWindow.VertIndex; console.log(value); // Specify the vertical distance that the active window is scrolled. app.ActiveWindow.VertIndex = 300; }
ActiveWindow.HorzIndex
By using the HorzIndex property, you can specify and obtain the horizontal distance that the active window is scrolled.
Syntax
expression.ActiveWindow.HorzIndexexpression: the document type application object.
Return values
Returns a Number that indicates the horizontal distance that the active window is scrolled. Unit: pixels.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the horizontal distance that the active window is scrolled. const value = await app.ActiveWindow.HorzIndex; console.log(value); // Specify the horizontal distance that the active window is scrolled. app.ActiveWindow.HorzIndex = 300; }