How to load Select Field values from a JsonP store?
I'm building a Touch app using Designer 2 build 288.
I have created a simple Form Panel with a FieldSet. One of my input form fields is a Select Field.
At runtime I want to load the possible values for my Select Field using the result of a JsonP call.
I have a model and a JsonP Store defined. The JsonP store's model property is set to the model name. I then specified my JsonP store for the "store" property value of my Select Field.
Unfortunately, the Select Field possible values do not appear when I run the app. However, I can see in the browser that the JsonP call is being triggered and the data containing possible value is returned from the server.
I feel like I'm missing something. What steps are required to properly link a Select Field to a JsonP store in Designer 2? Are there additional steps I need to take to map my JsonP store data to the "text" and "value" properties of my Select Field?
After sleeping on this and making a few tweaks I was able to get my Select Field values populated with values from a JsonP store.
Here are the additional steps I took:
1) Make sure your "rootProperty" Json reader property is populated if applicable. This was an oversight on my part.
2) Create your model with two fields named "value" and "text" to match the Select Field properties of the same names.
3) If your JsonP call does not return field names of "value" and "text," use the model fields' "mapping" property. Here you can specify which Json field names are used for the value and text fields in the model.