Created
February 13, 2010 19:16
-
-
Save jjulian/303634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ourStore = new Ext.data.JsonStore({ //change to JsonStore | |
url:'Chapter15Example.json', | |
root:'files', //add root here | |
fields: [ //add fields here | |
{name:'file_name',mapping:'name'}, | |
{name:'file_size',mapping:'size',type:'int'}, | |
'type', | |
{name:'lastmod',mapping:'datelastmodified',type:'date'}, | |
{name:'file_attributes',mapping:'attributes'}, //these last few fields are not in the source json | |
'mode', | |
'directory' | |
], | |
baseParams:{ //note to reader that this defaults to a POST | |
method: 'getFileInfoByPath', | |
returnFormat: 'JSON', | |
queryFormat: 'column', | |
startPath: '/images/' | |
}, | |
listeners:{ | |
load: function(store,records,options){ | |
console.log(records); | |
}, | |
exception: function(proxy,type,action,options,response,arg) { | |
console.log(arguments); //added to watch what was going wrong | |
} | |
} | |
}); | |
ourStore.load({ | |
params:{startPath:'/foo'} // you don't need to assign baseParams in 'beforeload' - the load() method does it for you | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment