[OutSystems Data Grid] Store  Accelerators.SearchData value from outsystem data grid
data-grid-reactive
Reactive icon
Forge component by Platform Maintenance
Application Type
Reactive

Hi Team,

I  want to store Accelerators.SearchData value from outsystem data grid.

Means If user search any value then I need to store search value.


For Example - I need to store "Test" value.


Thanks in advance.

Hi Nitin,

I don't see any in-built options to get the applied search keyword value. Though it might be a bit ugly suggestion to register event handlers to the search input and for the search button, it does the job :)

Used JS Snippet:

	
var gridSearchEle = document.getElementById($parameters.GridSearchId);

if (gridSearchEle) {
    var searchInput = gridSearchEle.querySelector('input[type="search"]');

    if (searchInput) {
        searchInput.addEventListener('keypress', function (e) {
            if (e.keyCode === 13) {
                $actions.SetSearchKeyword(e.target.value);
            }
        });
        
        gridSearchEle.querySelector('button').addEventListener('click', function() {
            $actions.SetSearchKeyword(searchInput.value);
        });
    }
}

See this demo screen: DG_SearchFeatureTask

Refer to the attached oml.

I hope this helps you!


Kind regards,

Benjith Sam

RWA_Ben_Lab_DG_SearchFeatureTask.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.