How to get a value from a cell with mouseover in jqgrid?

0

I need to get the value of a specific cell and move it to another tag HTML with mouseover .

I've tried:

gridComplete: function () {
 $('.jqgrow').mouseover(function(e) {
  var rowId = $(this).attr('id');
 });
},

But I only get the id of the line and not the value of the cell I want.

I've also tried:

$("#jqItensped").mouseover(function(){
 var wGrid    = $('#jqItensped');
 var selRowId = wGrid.jqGrid ('getGridParam', 'selrow');
 var jqObs1   = wGrid.jqGrid ('getCell', selRowId, 'observacao1');
 $("#Witemped_Obs1").val(jqObs1);
});

This function works perfectly with $("#jqItensped").click(function(){ , but with mouseover not.

What I need is pretty simple. The value is coming from AJAX, but I do not want to show it in jqGrid but rather in another tag of HTML.

    
asked by anonymous 24.02.2015 / 14:08

1 answer

1

For those who might be interested, I already have the solution:

$("#jqItensped").mouseover(function(e){
        var tr    = jQuery(e.target).closest('tr.jqgrow');
        var wGrid = $('#jqItensped');
        var rowId = tr.attr('id');
        if (rowId) {
            var jqObs1 = wGrid.jqGrid('getCell', rowId, 'observacao1');
            $("#Witemped_Obs1").val(jqObs1);
        }
});

It works with hidden columns as well.

    
24.02.2015 / 19:41