the event handler in the table column does not work

the event handler in the table column does not work

izumovizumov Posts: 178Questions: 14Answers: 0

my test case is http://montaj.vianor-konakovo.ru/goods.html

in the table with server processing in column 8, I output Editbox. And I got to the end of user input while leaving the element triggered the handler and was available as a reference to a string where the element is.I tried to associate the OnMouseLeave event with an element. here's the code

$('#goods tbody').on('OnMouseLeave', 'tr .inputEdit', function () {
    var table =$('#goods').DataTable();
        var row = $(this).closest('tr');
 
        var data = table.row( row ).data();  
    alert('add good'+data[8] )

What am I doing wrong that the handler doesn't work?How do I change the code to trigger the handler when leaving the EditBox?

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Try the change event.

  • izumovizumov Posts: 178Questions: 14Answers: 0

    on your advice, I made changes to the code.

    $('#goods tbody').on('change', 'tr .inputEdit', function () {
        var table =$('#goods').DataTable();
            var row = $(this).closest('tr');
     
            var data = table.row( row ).data();  // Used row instead of this
        alert('add good'+this.value )
    
    

    Тhe handler started to fire but failed in the handler to access the value entered by the user in the EditBox (this.value). Tell me how to do it correctly.

This discussion has been closed.