How to Invoke Data Source from a Template?

My current structure:

Page with a DataList component.

The DataList has an Invoke on its LoadData event.

I'm making a custom template for this DataList, so each row has a Dropdown.
This Dropdown will be filled with Data from another Invoke, and this new Invoke needs the parameter of the row, given by the DataList Invoke result...

The issue is, how can I create an Invoke for the Dropdown, by passing to it the data from each row of the DataList?
Because if I try to create an Invoke, I can only create it or in the main Load event of the page, or in the LoadData event of the DataList, but I neither places I have access to the parameter of each row..

How can I solve this?
Thank you

If you are using OData or some SQL database as data source you can use $expand to expand child data for your DropDown components.

@enchev sadly I'm using Swagger API calls for this, is there a solution in this case?

Maybe you can still return your child data if you have control on your swagger service. I'm afraid that I don't know any other option.

@enchev I just saw that you also have a component called "DropDownDataGrid",
how does that work? I see it has a "LoadData" event, couldn't I just use this in my ListGrid Template, and use its LoadData to make my API call, by passing the parameters with ${data.param} so it has access to each row of the ListGrid?

Yep, this most probably will work in your case. It's a DropDown with columns and paging.

1 Like

@enchev I tried implementing the DropDownDataGrid, but the main issue I'm having is, where I Can fire the "this.dropdownDataGridName.load()" ? So that it fires the LoadData event of this dropdown?
Because currently ,the only way to fire its LoadData, is to open the dropdown, and input something in the Search box, and search, then it will fire the event, but never before