jquery - jqgrid: Why am I reveiving "eData" instead of the id attribute value? -


jqgrid snippet:

gridcomplete: function(){      var ids = jquery("#breed_list").jqgrid('getdataids');     for(var i=0;i < ids.length;i++)     {         var cl = ids[i];         ed = "<img src="../images/edit.png" alt="edit" onclick="jquery('#breed_list').editrow('"+cl+"');" />";         de = "<img class="del_row" src="../images/delete.png" alt="delete" />";         ce = "<input class="del_row" type='button' onclick="deleterow()" />";         jquery("#breed_list").jqgrid('setrowdata',ids[i],{act:ed+de+ce});     }      $(this).mouseover(function() {         var valid = $('.ui-state-hover').attr("id");         jquery("#breed_list").setselection(valid, false);         alert(valid);         //deleterow(valid)     }); 

custom function code:

function deleterow(){      // selected row     var todelete = $("#breed_list").jqgrid('getgridparam','selrow');      // you'll pop-up confirmation dialog, , if yes,     // call "delete.php" on server.     $("#breed_list").jqgrid(         'delgridrow',         todelete,           {                url: 'delete.php',                reloadaftersubmit:false           }     );     //alert(todelete);  } 

that code auto selects hovered cell correctly when delgridrow not executed. when click button under actions column calls deleterow() function executes delgridrow. when click cancel delete form closes. now, when hover cell not auto select current hovered cell. debug placed alert(valid) in .mouseover function returns edata instead of id attribute value. alert(valid) alerts out id attribute value long deleterow function not executed. why edata set valid when should return id attribute value? how fix issue?

edit
apparently have been going hard way. went basic grid , gridcomplete.

jqgrid snippet:

de = "<input style='height:22px;width:20px;' type='button' value='d' onclick=\"deleterow('"+cl+"');\" />"; 

deleterow function code:

function deleterow(valid){      jquery("#breed_list").setselection(valid, false);      // you'll pop-up confirmation dialog, , if yes,     // call "delete.php" on server.     $("#breed_list").jqgrid(         'delgridrow',         valid,           {                 url: 'delete.php',                reloadaftersubmit:false           }     );     //alert(todelete);  } 

works charm now, still incorporate mousehover feature explained before.

apparently have been going hard way. went basic grid , gridcomplete.

jqgrid snippet:

    de = "<input style='height:22px;width:20px;' type='button' value='d' onclick=\"deleterow('"+cl+"');\" />";  deleterow function code:        function deleterow(valid){          jquery("#breed_list").setselection(valid, false);          // you'll pop-up confirmation dialog, , if yes,         // call "delete.php" on server.         $("#breed_list").jqgrid(             'delgridrow',             valid,               {                     url: 'delete.php',                    reloadaftersubmit:false               }         );         //alert(todelete);      } 

works charm now, still incorporate mousehover feature explained before.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -