EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: peter on January 10, 2017, 06:49:38 AM



Title: Programatically resize two connected panels
Post by: peter on January 10, 2017, 06:49:38 AM
I have a layout panel, with two sub panels, one marked as "center", and one marked as "west".

There is a divider between them which can be moved with a mouse.

Is the a way of moving the divider programatically, and if so, how?


Title: Re: Programatically resize two connected panels
Post by: Pierre on January 10, 2017, 07:06:54 AM
Hello
here is example:

Code:
      var c = $('#your_layout_id');            // layout
      var p = c.layout('panel','west');         // get the west panel
      p.panel('resize', {width:your_new_width});
      c.layout('resize');                         // resize layout ...


Title: Re: Programatically resize two connected panels
Post by: peter on January 10, 2017, 07:17:26 AM
Thank you for the prompt reply  :)


Title: Re: Programatically resize two connected panels
Post by: peter on January 15, 2017, 01:30:57 AM
Hi.

The code you gave me nearly works - to within a few pixels.

If you run this sequence you will see that the left panel gets smaller with the resize.

xx = $('#mainLayout').layout('panel','west').width()
$('#mainLayout').layout('panel','west').panel('resize', {width:xx})

Peter