[Data Grid Web] Data grid Refresh Issue. Not able to get new set of data After Ajax refresh
Forge component by OutSystems R&D
Application Type
Traditional Web
Service Studio Version
11.10.14 (Build 39807)

Hi Everyone,

In an app I am using data grid. Which fetches data from an api on page load and api return certain data records and also returns paging values to get remaining records. 

On page load it works fine and returns some data. But as per requirement when user clicks next/back/first/last I need to get new records. For that I need to add two extra parameters in the existing api call. I added two local variables and set it's values so that I can pass these to rest api call input parameters. After that I refresh the Grid to get new records.

So my issue here is that on page load it works fine with all parameters but when I change any input parameters value in api. It's removing those parameters from the request and it sends only parameters that are not changed.

Can anyone suggest what could be the issue or how it can be resolved.

Thsnks in advance.

Hi Mukesh,


Could you please try changing the input parameter or customize your request by using 'OnBeforeRequest' action ?

or could you please provide more information or send any screenshot how you are changing the i/p param?

mvp_badge
MVP

Hi Mukesh,

In order to get the previous or next record of data grid you don't need to call any api separately because if you have enabled the pagination property from Data-grid, you will get the options to navigate through the records easily 

but if you have created your own custom buttons for fetching the previous and next records

then my question is are you adding new parameters in you api?

or are you setting the values of those parameters which are available from beginning but with default values? 

Please help me in understanding your use case?

Regards,

Manish Jawla

Hi Manish,

The Back and Next are custom links which triggers a action that sets the two input parameters values. These input parameters are having default values but on back and next I am setting new values for these two parameters. These parameters then are getting passed to to rest url used in data grid's rest api url property.

In my case when page loads for the first time these parameters and thier default values are getting passed to api but when I set or change the values of input and ajax refresh the Grid or container having grid, they are getting removed from rest api url. This grid is in a web block. 

I found this by looking into network and logs. This happens to any parameters whose value is changed.

mvp_badge
MVP

Hi Mukesh,

Thanks for the clarification, are you calling the api server action again after setting the parameter's values like I shared in the below example:

In above example I used to set the search parameter value which is bind with input box and then call the getProductDataUrl action again which consists of rest API URL used in my datagrid and after that I used to refresh the data grid.

Please let me know if this helps, or can you share the screenshot of your custom link what so that I can analyze what steps you are performing.

Regards,

Manish Jawla

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