-
Notifications
You must be signed in to change notification settings - Fork 76
ViewItem
Jan Richter edited this page Apr 24, 2019
·
4 revisions
The best way to get an item reference is to use the findItem
method from ViewSection
.
const viewSection = ...;
const item = await viewSection.findItem('package.json');
// get item's label
const label = item.getLabel()
// find if item has children
const isParent = await item.hasChildren();
// find if item is expanded
const isExpanded = await item.isExpanded();
// collapse the item if expanded
await item.collapse();
// select the item and get its children if it ends up expanded, otherwise get an empty array
const children = await item.select();