1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    17
    Vote Rating
    0
    Dragonrider is on a distinguished road

      0  

    Default Unanswered: How to store data using ajax request into local storage?

    Unanswered: How to store data using ajax request into local storage?


    I am a new user to sencha.

    Right now I am showing data into list using ajax request but I want to store that data from ajax request to localstorage so, everytime I do not have to fetch particular data from the file.

    Data is stored into json file.

    Any help would be appreciated.

    Thanks


  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,669
    Answers
    3354
    Vote Rating
    747
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You will need two data stores... one that will get the data via ajax like you are doing and another to do the saving to localstorage. You would then have to use events in the live store to sync with the offline store.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    17
    Vote Rating
    0
    Dragonrider is on a distinguished road

      0  

    Default


    I tried by creating two stores one is for ajax request and another is for localstorage.

    I am using google chrome javascript console for cheking localstorage.

    It shows me localstorage with null values.

    Ext.Ajax.request({
    url: 'result.json',
    success: function(result) {
    var jsonData = Ext.util.JSON.decode(result.responseText);
    test.add(jsonData);
    });

    var test = new Ext.data.Store({
    storeId: 'Test',
    model: "testData",

    proxy:{
    type: 'localstorage',
    id: 'test-storage'
    }
    });

    Any solutions would be very grateful to me

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

      0  

    Default How to retrieve data using ajax request or local storage

    How to retrieve data using ajax request or local storage


    Hi...
    Am new to sencha and just started working with sencha architect 2, I went through the docs about loading data using store, model, ajax and local storage but yet am not able to get it exactly..My question may look pretty simple but pls bear it and answer step by step:
    1. I designed a simple login page like(Views):

    - Mytabpanel
    -Login // tab1
    -MyContainer2
    -MyNavigationview1
    -Myformpanel1
    -Mytextfield1 // Username
    -Mypasswordfield1 //Password
    -mybutton1
    -tap onmybuttontap1 // Login button
    -abc label // should display error if both textbox left empty

    -Menu // tab2
    -Mynavigationview
    -Mycontainer
    -Mypanel
    -Mylist
    -item tpl // not able to edit the default list then saw example giving local storage using model,store and ajax request but am not clear about it...


    -Map //tab3
    -Mynavigationview
    -mycontainer
    -MyMap2 // which displays google maps API is required...


    My needs:


    1. Navigation view doesn't provide default back button
    2. When first list is pressed, it should navigate to next page comprising of another three or five list //// tab2
    3. When username and password field left empty and clicked login tap should display an error in label
    4. Finally how to retrieve data from sql server 2005 using ajax request then local storage using store and model...
    Please bear it and try to answer me, i have also attached zip if possible try to modify it..
    Thanks in advance!!!
    Attached Files

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

      0  

    Default


    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!!!

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar