Home > DMT_EditorControl > getTabsBySplitScreenId
DMT_EditorControl.getTabsBySplitScreenId() method
Get all tabs under the specified split screen ID
Signature
typescript
function getTabsBySplitScreenId(splitScreenId: string): Promise<Array<IDMT_EditorTabItem>>;1
Parameters
Parameter | Type | Description |
|---|---|---|
splitScreenId | string | Split screen ID |
Returns
Promise<Array<IDMT_EditorTabItem>>
Tab list
Remarks
If there are no direct tabs under the specified split screen (that is, it still has children under it), an empty array will be returned
Example
javascript
// 1. 打开一个原理图页并读取分屏树,定位一个直接持有标签页的分屏
const pages = await eda.dmt_Schematic.getAllSchematicPagesInfo();
await eda.dmt_EditorControl.openDocument(pages[0].uuid);
const tree = await eda.dmt_EditorControl.getSplitScreenTree();
let leaf = null;
(function find(node) {
if (node.tabs?.length) { leaf = node; return; }
(node.children || []).forEach(find);
})(tree);
// 2. 查询该分屏下的所有标签页
const tabs = await eda.dmt_EditorControl.getTabsBySplitScreenId(leaf.id);
console.log('splitScreenId:', leaf.id);
console.log('tab count:', tabs.length);
console.log('titles:', tabs.map(t => t.title));1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15