1. #1
    Ext User
    Join Date
    Nov 2008
    Location
    Erlangen, Germany
    Posts
    18
    Vote Rating
    0
    stephan.raabe is on a distinguished road

      0  

    Default How to load grid store json from file in Application Storage Directory

    Hello,

    is it possible to load an text file including a JSON string from the application storage directory from my air application to the grid data store?

    Thanks,

    Stephan

  2. #2
    Ext JS Premium Member funkadelic's Avatar
    Join Date
    Mar 2008
    Location
    Mountain View, CA
    Posts
    44
    Vote Rating
    0
    funkadelic is on a distinguished road

      0  

    Default

    it should work. The JsonStore & GridPanel definition whould look something like this (referencing the file in the app-storage directory using the app-storage:/ shortcut) :

    Code:
    var someJsonstore = new Ext.data.JsonStore({
      url: 'app-storage:/some/text/file.js',
      root: 'rows',
      fields:[
        {name: 'field1'},
        {name: 'field2'},
        {name: 'field3'}
      ]
    });
    
    var panel = new Ext.grid.GridPanel({
      id: 'someId',
      store: someJsonStore,
      columns: [
        {...}
      ]
    });
    What are you playing? http://raptr.com
    Raptr Adobe AIR desktop client powered by Ext JS

Thread Participants: 1