Skip to content

Latest commit

 

History

History
45 lines (38 loc) · 1.01 KB

resources.md

File metadata and controls

45 lines (38 loc) · 1.01 KB

Shared resources in ExtJS (images, JSONs, XMLs)

If you want to share a resource, it should be put in the resources folder of your application as follows:

home-app
  |- app
    |- Application.js
    |- model
    |- store
    |- view
  |- resources              <- HERE
    |- menu.json
    |- data.xml
    |- logo.png

Do not forget to execute the sencha app build development (or production) command.

After successful build, the resource URL will be accessible via the poorly documented Ext.getResourcePath function:

{
    xtype: "treepanel",
    title: "Menu",
    store: {
        type: "tree",
        proxy: {
            type: 'ajax',
            url: Ext.getResourcePath('menu.json'),
            reader: {
                type: 'json',
                rootProperty: 'children'
            }
        },
        root: {
            expanded: true,
            text: "Examples"
        }
    }
}

See Resource Management