1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    9
    Vote Rating
    0
    cstuber is on a distinguished road

      0  

    Question How to load Select Field values from a JsonP store?

    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?

    Any help would be appreciated!

    Chad

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    9
    Vote Rating
    0
    cstuber is on a distinguished road

      0  

    Default


    Hi everyone,

    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.

    After those changes everything is working great!

    Chad

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,369
    Vote Rating
    128
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Chad, Thanks for updating the thread and letting everyone know how you solved the problem.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Posts
    16
    Vote Rating
    0
    avrmraja is on a distinguished road

      0  

    Default Not able to load data using jsonp in store

    Not able to load data using jsonp in store


    Hi...I managed to display data using a webservice url in list with


    navigation view in the designer but when it runs in browser it displays


    empty then upon some reference for cross domain heard JSONP should be


    used.. But not able to load data to store using jsonp.. It displays


    error "unable to load data with specified configuration".. I loaded


    model using rest proxy is ter any changes to be made..
    Thanks in advance!!!

  5. #5
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    5
    Vote Rating
    0
    soportedo is on a distinguished road

      0  

    Default


    Can you post your store, and model?

    I can't get Jsonp to work with stores.... =(