Update a pane

Example

Click the button to update the right pane's title and content. See updatePane API for more details. The example below is hosted within an iframe. You can also view it here.



<button id="update-pane">Update pane</button>
<div id="container" style="width: 400px; height: 260px"></div>
const bwin = new BinaryWindow({
  fitContainer: true,
  children: [
    { position: 'left', id: 'pane-1', content: 'Pane 1' },
    {
      position: 'right',
      id: 'pane-2',
      title: 'Pane 2',
      content: 'Pane 2',
    },
  ],
});

bwin.mount(document.getElementById('container'));

document.getElementById('update-pane').addEventListener('click', () => {
  bwin.updatePane('pane-2', {
    title: 'Updated',
    content: Object.assign(document.createElement('em'), { innerHTML: 'Updated content' }),
  });
});