EasyUI Forum
October 17, 2025, 06:45:48 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: nesting components (window + datagrid)  (Read 15781 times)
gurpal2000
Newbie
*
Posts: 14


View Profile
« on: September 10, 2012, 08:17:31 AM »

Hi

how does one nest Easy components?

I need a window (or maybe a dialog?) with a autofit grid in it. I don't want to markup the attributes in html, but rather javascript/jquery.

I didn't see an "items" or "components" attribute for say a window.

I tried something like:

Code:
$('#ss').spinner({  
   required:true,  
   increment:10
});

$('#divAdmin').window({
title: 'Dialog',
width: 400,
height: 200,
modal: true
});

<div id="divAdmin">
<input id="ss" value="2"/>
</div>


but this doesn't show or size automatically. Or do i bind the additional components at window create/show time ?

thanks
Logged
gurpal2000
Newbie
*
Posts: 14


View Profile
« Reply #1 on: September 12, 2012, 04:35:06 PM »

ok i managed to do the nesting. but i can't seem to autofit the grid into the dialog size. Or vice versa. "auto" doesn't seem to work for width/heights?

Code:
<div id="divAdmin">
<table id="tableRescan"/>
</div>

$('#tableRescan').datagrid({
url: 'rescan',
remoteSort: false,
width: 400,
height: 200,
idField: 'fmtdate',
columns:[[{
field: 'fmtdate',
title: 'date',
width: 100
}]]
});

$('#divAdmin').dialog({
title: 'dia',
width: 500,
height: 300,
modal: true
});
});
Logged
gurpal2000
Newbie
*
Posts: 14


View Profile
« Reply #2 on: September 12, 2012, 04:44:49 PM »

aha worked it out Smiley

Code:
$('#tableRescan').datagrid('options').onResize = function() {
$('#divAdmin').dialog('resize');
};

when the table gets sized, so does the dialog. is this the best practice?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: September 12, 2012, 06:46:47 PM »

Please add 'fit' property for datagrid and set its value to true.
Logged
gurpal2000
Newbie
*
Posts: 14


View Profile
« Reply #4 on: September 13, 2012, 06:02:06 AM »

hi yes i ended up doing exactly that (fit: true) and removing this resize code. works great.
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!