95
Views
1
Comments
Editable Table - On Row Cancel Action Doesn't Work

I try this Code on this Post but it doesn't solve my problem

"<script>
function actoncancel() {
  document.getElementById('"+OnCancelLink.Id+"').click()
};
function captureclick() {
    $('.CancelRowAction').off('click', actoncancel);
    $('.CancelRowAction').on('click', actoncancel);
};
$('.EditableTable').on('click', captureclick)
</script>"

I have this Expression Script with Escape Content as No
In which if the user click the editable table and press the X it will go click the cancel button and will refresh the table for it to go back to it's default values. 

But I try debugging it and once I click the X on the editable table it doesn't go to the Screen Action...

I think this issue is on the Editable Table itself? I don't know, anyone who encounter this?

mvp_badge
MVP
Rank: #90

Hi Willter Desamparado,

You are right, I also tried with the same JS code and it is not working as required. 

Solution Step

1) Define the below code snippet within an Expression widget with the Escape Content set to No 

2) Set the Hidden button Visible property to True and define the hidden button extended properties to style = display:none; .


Code Snippet

"<script>
   
    $('.EditableTable').on('click', '.CancelRowAction', function () {
        $('#" + Btn_Hidden.Id + "').click();
    });

</script>"


Check this: Demo Screen


Code Snippet to catch EditableTable Cancel event

 $(".EditableTable").on('click', '.CancelRowAction', function () {
        //your code goes here....
 });


Hope this helps you!


Regards,

Benjith Sam