I have checked some other posts about this and it seems they are all outdated.
I’m passing a couple of query params in a modal that loads a page. On that page if I use mustache to read that query param, it works.
{{$Param.my_great_param}}
Now when I try to access the same via javascript, they simply does not exist.
How can I access that param inside my javascript? I’m using it to load information that is related to the action/objects/etc.
Things that I have tried so far:
- skuid.page.params → for some reason only return the modal inner page params
- creating an ui only model that I could associate the field with the param → doesn’t work because there is no way to inform the model to use that param for the first row and conditionals on the model itself doesn’t support that
- using raw javascript to read the query parameters → just to find out that just like the skuid.page.params it does not have that param that is available through mustache
Any help appreciated. Right now I’m thinking in doing something really ugly and hacky.
Update:
Just tried the hacky way and it doesn’t work because the mustache parameter is only translated after the page is loaded.
Update 2:
To solve it I had to use a 2nd hacky way to get to the information.
Ui-Only Model
→ 1 field per parameter
→ model action
→ when model is required
→ update model
→ add field
→ associate the field with formula
→ on the formula use the mustache parameter.
When the page is loaded the model will then have the parameters values. For you to access the values via javascript:
Load model
→ get rows
→ use first row
→ get the value of the parameter you need.