EasyUI Forum
March 29, 2024, 02:42:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Programatically resize two connected panels  (Read 6121 times)
peter
Newbie
*
Posts: 10


View Profile
« 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?
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #1 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 ...
« Last Edit: January 10, 2017, 07:08:49 AM by Pierre » Logged
peter
Newbie
*
Posts: 10


View Profile
« Reply #2 on: January 10, 2017, 07:17:26 AM »

Thank you for the prompt reply  Smiley
Logged
peter
Newbie
*
Posts: 10


View Profile
« Reply #3 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!