Tutorial: Layout.getRootItem

Layout.getRootItem

Retrieves the layout container's root item which will be a ColumnOrRow type. Cannot be called from a View.

if (!fin.me.isWindow) {
    throw new Error('Not running in a platform View.');
}

// From the layout window
const layout = fin.Platform.Layout.getCurrentSync();
// Retrieves the ColumnOrRow instance
const rootItem = await layout.getRootItem();
const content = await rootItem.getContent();
console.log(`The root ColumnOrRow instance has ${content.length} item(s)`);