Skip to content

ViewItem

Jan Richter edited this page Apr 24, 2019 · 4 revisions

item

Lookup

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');

Actions

// 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();
Clone this wiki locally