EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on December 30, 2016, 06:59:54 AM



Title: datagrid + combobox
Post by: rezzonico on December 30, 2016, 06:59:54 AM
Hi all,

I have a strange effect with the following program:

http://195.144.40.170/jeasyui/RRR/index.html

Please, select "New line" and then in the combobox select the number "2".
Close the alert window and then in the combobox select the number "3".
In the alert window you can read "You select 2".

Why "2" and not "3" ?
I realize that you always see the previous selected number.

Strange is that if I replace the combobox with a combogrid all works as expected.

Thanks for any help.


Miche


Title: Re: datagrid + combobox
Post by: jarry on December 31, 2016, 07:06:25 AM
Please use the code below instead.
Code:
$.fn.combobox.defaults.onSelect = function(value) {
 $(this).val(value.TdA);
 $(this).trigger('change');
}
function setEditingOdLlabor(rowIndex) {
 var editors = $('#dg_OdLlabor').datagrid('getEditors', rowIndex);
 var tdaEditor = editors[0];

 tdaEditor.target.bind('change', function() {
  var tda = $(this).val();
    var strng = "You select " + tda;
    alert(strng);
 });
}


Title: Re: datagrid + combobox
Post by: rezzonico on January 02, 2017, 06:40:50 AM
Thanks a lot for you help.

Miche