EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: svsnead on February 25, 2016, 06:48:59 AM



Title: placement of combobox [SOLVED]
Post by: svsnead on February 25, 2016, 06:48:59 AM
I have been trying to place a combobox that I using to a location. I can change the width and height but I can not change the left right bottom or top. How do you place a combobox. I will have more than one combobox and need to place each on so overriding the css is not going to work. Someone's help would be really appreciated. I tried using a class to set the top and left position but it does not work.

Here is the code:
Code:

              <input class="easyui-combobox test"  name="status" value="name"
       data-options="valueField:'id',textField:'text',url:'data/combobox_data.json'">

.test {
  position: absolute;
  top: 139px;
  left:400px;
}




I guess it is the 'textbox combo' class that needs to have the style left and top, but I'm not sure how set it. I have googled that heck of it and I cannot find and example or info on how to place a combobox as far as top and left position. Any help would be appreciated.

(http://www.bshdfcle.org/wp-content/themes/html5blank-bshdfc/src/test/combobox.jpg)



Changing the combo css works but that would change all combo boxes.


Code:
.combo {
  position: absolute;
  top: 139px;
  left:400px;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  border-width: 1px;
  border-style: solid;
  overflow: hidden;
  vertical-align: middle;
}


I tried addClass to the combobox span so that is would add the top and left positions but it did not work either. I tried
'span:first' but that did not work at all.

Code:
  $('#cc').combobox({
   onLoadSuccess: function(){
$("span").addClass("c1");
}
  });

.c1 {
  position: absolute;
  top: 139px;
  left:400px;
}





Title: Re: placement of combobox
Post by: svsnead on February 25, 2016, 11:36:41 AM
I tried to use the position method to see if it would offset the element but it does not move at all.

Code:
                     <div>
                     <input id="status" class="easyui-combobox"  name="status" value="name"
       data-options="valueField:'id',textField:'text',url:'data/combobox_data.json'">
</div>


$("#status").position({
  of: $('#status').parent(),
  my: 'left top',
  at: 'left top',
  offset: '160 160'
});


Whew! I cannot figure it out for sure. I cannot believe that there is not a way to set the top or left style. When I use the width this work for width just not for top or left.

I tried this:

Code:
                     <div>
                     <input class="easyui-combobox"  name="status" value="status"
       data-options="valueField:'id',textField:'text',url:'data/combobox_data.json',top:'250px;'">
</div>


Title: Re: placement of combobox
Post by: jarry on February 25, 2016, 03:18:04 PM
Please put the c1 class for the parent container of combobox component.
Code:
<div class="c1">
                      <input id="status" class="easyui-combobox"  name="status" value="name"
        data-options="valueField:'id',textField:'text',url:'data/combobox_data.json'">
</div>


Title: Re: placement of combobox [SOLVED]
Post by: svsnead on February 25, 2016, 03:30:05 PM
Oh my I sure made that difficult... Thank you Thank you Thank you..... That was one think I did not try.