EasyUI Forum
November 06, 2025, 06:45:13 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: fit combo, combobox or combogrid to parent div  (Read 14045 times)
Ellipsis
Full Member
***
Posts: 113


View Profile WWW
« on: March 14, 2013, 12:00:58 PM »

Is it possible to auto fit the input element (selectbox) to the parent div?

The input elements we use have no label and are positioned in a small heigh sidebar.
We tried some methods to set the width of the combogrids after load, by getting the parent innerwidth. But using standard easyui functionality would be cleaner I asume.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 14, 2013, 06:12:20 PM »

The searchbox is not the container component, it has not 'fit' property. The only way to fit a searchbox to its parent div container is to recreate it with 'width' and 'height' properties or call 'resize' method to resize it after created.

Code:
	<div style="width:200px;height:30px;border:1px solid #ccc">
<input id="sb" data-options="prompt:'Please Input Value'"></input>
</div>
<script>
$(function(){
var p = $('#sb').parent();
$('#sb').searchbox({
width: p.width(),
height: p.height()
});
});
</script>

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!