I'm working with Jqgrid and (with you help) I made this formatter:
function editarFormatter(cellvalue, options, rowObject) {
var cellValue = cellvalue;
var url="<a href='editar_equipo.php?equi_id=" + cellValue + "'><img src='images/edit_icon.gif' alt='" + cellValue + "' title='Editar: " + cellValue + "' />Editar</a>";
url+="<a href='eliminar.php?equi_id=" + cellValue + "'><img src='images/trash.png' alt='" + cellValue + "' title='Eliminar: " + cellValue + "' />Eliminar</a>";
return url;
};
What return this as a column for each row:
The "Editar" (Edit) Button redirects without problem to another .php page with a form that edits the info of that row.
But for the Delete button, I don't wanna redirect to another page. Instead, I want a dialog where ask me if I want to delete that row, with "Yes" and "No" options, just like the delete button from the "Actions" Formatter.
I already saw How can I implement a custom jqGrid delete button? and Custom delete button in jqGrid, But can't figure out how apply them to the link whit icon of my formatter.
Any help will be apreciated! :) Thank you in advance!