0
ryan.mennell created
- What is your product version? 9
- What is your product type (Angular or MVC)? MVC Jquery
- What is product framework type (.net framework or .net core)? .NET Core
Issue
In our project, we need filter dropdown values and MapBoxMapLoadLimitPerTenant to validate a map load. currently i'm getting this data by calling:
$.getJSON('/App/Jobs/GetJobsWidgetModelData'
Later in the widget JS file I'm calling:
_commonService.updateAndGetMapBoxLoadCount
which actually uses value of MapBoxMapLoadLimitPerTenant and shows a custom error. However, there is inconsistency with which API call will finish first.
in short, I want initialized data from razor view to widget's js(customisable dashboard) file. Could you help me find a solution?
Thanks Ryan
1 Answer(s)
-
0
Hi,
You can use https://aspnetboilerplate.com/Pages/Documents/Javascript-API/Event-Bus. Just trigger an event from complete event of the call you want to be completed first. Then, catch it from the second event's js file and execute the second one.