[Data Grid] [ Sample Needed ] - JavaScript script to call Data Grid action button

Forge Component
(32)
Published on 4 Dec (4 days ago) by OutSystems R&D
32 votes
Published on 4 Dec (4 days ago) by OutSystems R&D

HI,


If I need to create my own button and call for the below action, what is the JavaScript code I should use?




For example, for SendDirtyRowsButton action, I can create a button and specify the below JavaScript code within the "onclick" event. Refer to: https://www.outsystems.com/forums/discussion/51384/data-grid-senddirtyrowsbutton-how-to-re-enable-it-after-save/#Post190999 and Thanks for @Dorine Boudry's help.

"
GridOS.dirtyItemsFeature.sendJsonDirtyElements(
    this, 
    '/DataGridExample/rest/Orders/SaveOrders',
    'POST',
    false,
    '"+ Grid.Id +"',
    'SampleGridFunctions.confirmMessage(""Are you sure?"")',
    '',
    true,
    true); 
" 

The sample here might give you an idea of how to do it , 


https://www.outsystems.com/forums/discussion/51430/data-grid-how-to-generate-a-pop-up-from-link-click/ 


I have used links. But can easily be replaced with buttons.