EasyUI Forum
March 28, 2024, 02:19:42 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: datagrid + combobox  (Read 3919 times)
rezzonico
Full Member
***
Posts: 182


View Profile
« 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
Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 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);
 });
}
Logged
rezzonico
Full Member
***
Posts: 182


View Profile
« Reply #2 on: January 02, 2017, 06:40:50 AM »

Thanks a lot for you help.

Miche
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!