jqgrid: I would like to auto select the cell my mouse is currently hovering over
Currently I have:
jqgrid code 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\开发者_如何学Python" type='button' onclick=\"deleteRow()\" />";
jQuery("#breed_list").jqGrid('setRowData',ids[i],{act:ed+de+ce});
}
$(this).mouseover(function() {
//do code
});
},
Problem:
The function will NOT execute when I click the button without the cell selected. If I select the cell then click the button the deleteRow() function will execute.Possible Solution?:
The idea is to auto select the cell my mouse is currenAtly hovering for when the user does click the button the function will execute properly. All other ideas are welcome :-)EDIT
Working Code: The idea of auto select the cell was rather simple with jQuery.code:
$(this).mouseover(function() {
var valId = $(".ui-state-hover").attr("id");
jQuery("#breed_list").setSelection(valId, false);
//alert(valId);
});
-Rich
Working Code:
The idea of auto select the cell was rather simple with jQuery.
code:
$(this).mouseover(function() {
var valId = $(".ui-state-hover").attr("id");
jQuery("#breed_list").setSelection(valId, false);
//alert(valId);
});
精彩评论