Search code examples
javascriptextjscontainershbox

ExtJS hbox draggable vertical line


In ExtJS 4.2.2. I have an hbox container like this:

Ext.create('Ext.Panel', {
  width: 500,
  height: 300,
  title: "HBoxLayout Panel",
  layout: {
    type: 'hbox',
    align: 'stretch'
  },
  renderTo: document.body,
  items: [{
    xtype: 'panel',
    title: 'Inner Panel One',
    flex: 2
  },{
    xtype: 'panel',
    title: 'Inner Panel Two',
    flex: 1
  },{
    xtype: 'panel',
    title: 'Inner Panel Three',
    flex: 1
  }]
});

It is just the example in the docs. But i want the vertical line between the three different panels to be draggable, so the user is able to adjust the size of each panel.

Thank you for your help!


Solution

  • You are looking for Splitter. Between your panels, add:

    {xtype: 'splitter'}
    

    Example: https://fiddle.sencha.com/#fiddle/r4h