Forum


09:36

24/01/2009

Hello all,
jqgrid snippet:
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:
// Get the currently selected row
var toDelete = $("#breed_list").jqGrid('getGridParam','selrow');
// You'll get a pop-up confirmation dialog, and if you say yes,
// it will call "delete.php" on your server.
$("#breed_list").jqGrid(
'delGridRow',
toDelete,
{
url: 'delete.php',
reloadAfterSubmit:false
}
);
//alert(toDelete);
}
That code auto selects the hovered cell correctly when delGridRow is NOT executed. When I click the button under the actions column it calls the deleteRow() function which executes delGridRow. When I click cancel the delete form closes. Now, when I hover a cell it does NOT auto select the current hovered cell. To debug this I placed alert(valId) in the .mouseover function which returns eData instead of the id attribute value. alert(valId) alerts out the id attribute value as long as the deleteRow function is not executed. Why is eData set to valId when it should return the id attribute value? How do I fix this issue?
-Thank You,
Rich
Most Users Ever Online: 715
Currently Online:
53 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66