Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
ig grid - When clicking on button located in unbound column, iggridupdatingeditrowended is also firing
posted

Relevant problem #1

Grid update mode is row.

The default delete hover buttons are not actually placed in the row but it is an element that "attempts" to absolutely position it after the row end. This of course fails and the delete button is broken. 

Problem #2 

Note* I have used jQuery to remove the default non-working delete hover button.

So to fix the above I have added an unbound row which I populate using a formula to place a Delete button within the grid. First issue I faced was with the Delete button when clicking that it causes the whole row to become edited. This is not ideal, because then it blocks the Delete button click. This is fixed by disabling the column field as an editable field. 


// Prevents the Delete column being editable
$(document)
.delegate("#igGrid",
"iggridupdatingeditcellstarting",
function (evt, ui) {
  if (ui.columnKey === "Delete") {
      return false;
  }
   return true;
});

This is fine but not ideal as when I click the Delete button the rest of the row is still going into edit mode. So here comes the final problem and the one this topic is trying to address. When I press the Delete button, my own function to delete the row fires but then also the "iggridupdatingeditrowended" fires. This causes 2 transactions to occur, 1st to delete the row and then 2nd to update the non-existent row. When in the MVC controller I just process the delete row the Editrowended is re-added the deleted row back to the iggrid.

Is there a fix and perhaps a more elegant solution to my problem? Is there no solution and must I use some external dialogs/views/controls outside of igniteui to edit/delete the rows?