EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: y.bykov on April 04, 2017, 02:48:52 AM



Title: Reducing HTML code in comboboxes
Post by: y.bykov on April 04, 2017, 02:48:52 AM
I have two combobox with loaded data (almost 10000 rows, same data).
Is it possible to config combobox(es) to reduce html code and create/using only one DIV combo-panel?
Thank you!


Title: Re: Reducing HTML code in comboboxes
Post by: jarry on April 04, 2017, 08:08:22 AM
You can call 'cloneFrom' method to create combobox components that will share the same drop-down panel.
Code:
<input id="cc" class="easyui-combobox" style="width:200px;" data-options="
    url:'combobox_data1.json',
    method:'get',
    valueField:'id',
    textField:'text',
    panelHeight:'auto'
    ">
<input class="c1">
<input class="c1">
<input class="c1">
<input class="c1">
<script type="text/javascript">
  $(function(){
    $('.c1').combobox('cloneFrom','#cc');
  })
</script>


Title: Re: Reducing HTML code in comboboxes
Post by: y.bykov on April 06, 2017, 10:24:09 AM
Thank you!