How to take a value of a cell with mouseover in jqgrid?

Asked

Viewed 355 times

0

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

I’ve tried to:

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

but I can only get the id line and not the cell value I want.

I tried too:

$("#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 nay.

What I need is quite simple. The value is coming from AJAX, but I don’t want to show it in jqGrid but in another tag of HTML.

1 answer

1

For those who might be interested, I’ve already found 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);
        }
});

Works with column Hidden also.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.