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
845
Cancelled event ALWAYS cancelled subsequently
posted

Hello,

I am using an igHierarchicalGrid with update enabled (2nd level only). While a cell is in edit mode, I change the "Save Changes" button text to be "Not Ready", and back to "Save Changes" when the user exits the cell, to ensure the change is registered.

In the "ighierarchicalgridrowexpanding" and "ighierarchicalgridrowcollapsing" events, i want to cancel the expanding of other rows or the collapsing of the current row when the text of the Save button is "Not Ready", but allow it when it is "Save Changes". Here is the "ighierarchicalgridrowexpanding" jQuery function:

$("#grdReceipts").live("ighierarchicalgridrowexpanding", function (event, ui) {                    

    if ($("#saveChanges").val() == "Not Ready") {                

         return false;            

          }                    

});  

Before the event is cancelled for the first time (before the text is changed to "Not Ready"), the rows can be expanded and collapsed with no problem. When a cell is in edit mode and the text is changed to "Not Ready", the events are cancelled correctly.

However, when the cell is no longer in Edit Mode and the text is set back to "Save Changes", the event is STILL cancelled. This is despite the If statement in the event not returning false.

What am i doing wrong? Why does the event always get cancelled?

Thanks

Deon