EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: serit on February 03, 2022, 10:10:26 AM



Title: Combogrid multiple select options to send values and load values
Post by: serit on February 03, 2022, 10:10:26 AM
How to use combogrid with multiple select options to send values in form and load values on load form for edit?
I Have my code ;

Code:
<select required="" class="easyui-combogrid combogrid-f combo-f textbox-f" id="contracts_tickets" style="width: 100%; display: none;" data-options="
panelWidth: '20%',
multiple:true,
idField: 'phc_cognitive_contracts',
textField: 'local_contracts',
url: 'lib/tableActions.php?table=contracts',
columns: [[{'field':'phc_cognitive_contracts','title':'<b lang=en>Phc cognitive</b>','sortable':'true'},{'field':'commercial_name_contracts','title':'<b lang=en>Commercial name</b>','sortable':'true'},{'field':'telefonica_contracts','title':'<b lang=en>Telefonica</b>','sortable':'true'},{'field':'local_contracts','title':'<b lang=en>Local</b>','sortable':'true'}]],
fitColumns: true,
label: '<b lang=en>Contracts</b>',
labelPosition: 'top'
" textboxname="contracts_tickets[]" comboname="contracts_tickets[]">
</select>

If I use on tag name contracts_tickets[] I can save the multiples values on my database with comma separated values.
But I can't load the values on form load

If I use just the name contracts_tickets without [] send with same name the multiple values for form but I only can save the last value and it's possible to load at least one value on form load for edit.

Can you help me?
thanks in advance


Title: Re: Combogrid multiple select options to send values and load values
Post by: jarry on February 06, 2022, 03:10:33 AM
You should load the multiple fields with an array value. Please refer to the code below.
Code:
$('#ff').form('load', {
  'contracts_tickets[]': [v1,v2]
  ...
});