I've created a relatively complex dashboard that represents data across all the states. All my widgets are in-sync and properly update when the user changes selections, etc. I had a request to provide this dashboard, but at the state level only. Since I already have a state list widget setup, I was hoping to use everything that is currently working and simply set the selected state in the list widget. I have the code to determine the state the user is from, but I cannot find a good function to set the default value.
Solved! Go to Solution.
Thanks Jeffrey. I was experimenting with some code in that function and will go back and take a closer look. I agree that it seemed like the logical place to add my code.
It looks like a class based React component. I would try setting up a componentDidMount() function.
https://legacy.reactjs.org/docs/react-component.html#componentdidmount
Jeffrey - To follow up on the question. I was able to get the foundation of my code working, by using componentDidUpdate function. I had to add code to make sure the datasource was "Loaded" and not "Loading". datasource.getStatus() === DataSourceStatus.Loading
Once I was sure the dataSource was loaded, I was able to call SelectRecords, using an appropriate DataRecord.
Now it's time to fill in the rest of the code.
Thanks Jeffrey. I was experimenting with some code in that function and will go back and take a closer look. I agree that it seemed like the logical place to add my code.