EasyUI Forum
September 16, 2025, 03:53:14 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: on resize, resize all children  (Read 17111 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: March 06, 2013, 09:49:29 PM »

Is it possible to globally run the resize() method on all easyui-object children when the containing panel is resized ??
Code:
    $('#center').panel({  
    onResize:function(){ 
        //$(this).easyui.resize
    } 
});
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 06, 2013, 11:28:52 PM »

Set the 'fit' property to true for a component and it will be automatically resized when its container panel is resized.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: March 07, 2013, 05:31:36 AM »

Thanks;

fit=true is already set on the datagrid in the main panel, but when the left hand menu panel is collapsed or resized, the datagrid does not re-size to the new full width of the main panel.





Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: March 07, 2013, 08:08:31 AM »

Please refer to this sample http://www.jeasyui.com/demo/main/index.php?plugin=Layout&theme=default&dir=ltr&pitem=Basic. When the left panel is collapsed or resized, the datagrid is automatically resized to full fill its container space.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #4 on: March 08, 2013, 01:02:52 AM »

Thanks, it only appears to work when the datagrid is the first element in the container.

Take a look at this: http://jsfiddle.net/Chqxu/1/

Thanks
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: March 08, 2013, 02:51:56 AM »

Here is the updated example that solved your issue.
http://jsfiddle.net/Chqxu/2/
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #6 on: March 08, 2013, 04:06:21 AM »

Thanks so much for helping, unfortunately that only works if the datagrid is the first element in the form, but in most cases it is not there are other elements above it.

See updated fillde: http://jsfiddle.net/Chqxu/7/

« Last Edit: March 08, 2013, 06:13:40 PM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #7 on: March 09, 2013, 07:15:36 AM »

Here is the updated example http://jsfiddle.net/Chqxu/10/ that using nested layout to solve your issue.
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!