Intermediate jQuery
Scenario:
Provide a lookup for an optional input where the data is expensive to get. Or, perhaps the input is not optional, but if already filled in, there's no reason to get the full datasource of possibilities unless the user wants to change the value.
Solution
Use a jquery dialog for the lookup and only get the data if opened.
Solution Outline
- Add input to capture user's age in dog years
- Add link to "lookup" the correct value
- Add a dialog that opens when the lookup link is clicked
- Wire event that will load the hard-coded data when the dialog first opens
- Add an action on the home controller to get the script data
- Modify open event to call the action instead of using the hard-coded data
References
jQuery
jQuery UI
JSON parser and stringifier