EasyUI Forum
May 05, 2024, 12:58:33 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: Window size  (Read 12497 times)
nwguy
Newbie
*
Posts: 2


View Profile Email
« on: November 12, 2013, 06:39:04 PM »

I'm using a window as a modal dialog box, defined like so:
Code:
<div id="selectOrder" class="easyui-window" title="Get Order" data-options="modal:true,closed:true,left:160,top:170,minimizable:false,maximizable:false,collapsible:false" style="padding:10px;">
<div id="orders" style="white-space:nowrap;"></div>
<a id="cancelOrders" href="javascript:void(0)" class="b_lnk" style="float:right;">Cancel</a>
</div>

Some javascript populates the the "orders" div. When I call the window.open() method, the dialog appears with a width only as wide as the "cancelOrders" button. The wider content in the "orders" div is truncated on the right. Is there a way to "reset" the width after populating the div with content so it sizes automatically? Using size:auto doesn't work in the "selectOrder" div's options. I tried using jQuery's .css() method to set the width of the "selectOrder" div to auto after populating the "orders" div. The "selectOrders" div then sized correctly, but the close button at the top right didn't move over to the far right, and the inner border didn't render correctly.

I guess in short I'm asking how to automatically (no pixel dimensions) set the width of a window after populating it with data from an ajax call?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 12, 2013, 07:32:12 PM »

Try the code below to auto adjust the width according to its contents.
Code:
var w = $('#selectOrder');
w.window('header').css('width','');
w.window('body').css('width','');
w.window('resize',{width:'auto',height:'auto'});
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!