Tutorial: Layout.closeView

Layout.closeView

Closes a specified view in a target window.

Example


let { identity } = fin.Window.getCurrentSync();
let viewOptions = {
    name: 'test_view',
    url: 'https://example.com'
};

function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

fin.Layout.createView(viewOptions, identity);
// a new view will now show in the current window

await sleep(5000);

fin.Layout.closeView(viewOptions, identity);
// the view will now close