Jump to content
  • 0

Disable BulkEdit 'Update' button when it is already clicked


thead
 Share

Question

1 answer to this question

Recommended Posts

  • 0

Hi Thead,

Yes it is possible. You can use the following JavaScript code that will be inserted into the Footer of 'Configure Results Page Fields', which will, after first click on 'Update' button, disable it, and change its value to 'Processing':

<script>
document.addEventListener('DataPageReady', function (event) {
         const target = document.querySelector('body');
         const observer = new MutationObserver(mutations => {
              const updateBtn = document.querySelector('input[value="Update"]');
              if(updateBtn){
                        updateBtn.addEventListener('click',function(){
                                   disable(this);
                        });
              }
         });
         const config = {subtree:true, childList:true};
         observer.observe(target, config);

         function disable(btn){
                 btn.disabled = true;
                 btn.value = 'Processing';
                 btn.removeEventListener('click',disable);
         }
});
</script>


Hope this helps.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...