Jump to content
  • 0

Updating a status field when button is clicked


DDNex

Question

3 answers to this question

Recommended Posts

  • 0

Hi there!

Such functionality could be added using some JavaScript coding. 

I wrote a script that you can test here and let me know if this is something you are looking to achieve:

https://c7eku786.caspio.com/dp/7f80b000996248acff124d7d8b06

Upon clicking on "Update," it changes the value of the Status field to "updated."

Here is a script that you can add to the header of your report datapage:

<script>

document.addEventListener('DataPageReady', _=> {

const observer = new MutationObserver( mutationRecords => {
    let inputSelector = 'input.cbResultSetTextField';
    let inputUdatedValue = 'updated';  
    let inputToUpdate = document.querySelector(inputSelector);
       if(inputToUpdate!=null) {
       inputToUpdate.value = inputUdatedValue;
       let row = inputToUpdate.parentElement.parentElement.parentElement;
       row.style = 'opacity: 0';
       window.setTimeout( _=> {
       if(document.querySelector('input[name="Mod0InlineEdit"]')!=null) {
           row.style = 'opacity: 100';
        document.querySelector('input[name="Mod0InlineEdit"]').click()
        }}, 100)
    }
    
}
)

document.querySelectorAll('.cbResultSetData').forEach(input=> {
observer.observe(input, {childList: true, subtree: true});

})

})

</script>

 

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...
×
×
  • Create New...