Tutorial: View.updateOptions

View.updateOptions

Updates the options for a View.

Example

let view;
async function createView() {
    const me = await fin.Window.getCurrent();
    return fin.View.create({ 
        url: 'https://google.com', 
        name: 'viewNameUpdateOptions', 
        target: me.identity, 
        bounds: {top: 10, left: 10, width: 200, height: 200} 
    });
}

async function updateViewOptions() {
    view = await createView();
    console.log('View created.');

    await view.navigate('https://google.com');
    console.log('View navigated to given url option.');

    const newOptions = { autoResize: {
        width: true,
        horizontal: true
    }};
    return view.updateOptions(newOptions);
}

updateViewOptions()
    .then(payload => console.log('View options updated: ', payload))
    .catch(err => console.log(err));