Hello Guys,

I'm trying to Open a File and load this file in a Store and Show this in a Tree.

How can i get it work.

I have Created a little Example to Show you how i'm trying it.

app.js

Code:
Ext.application({    name: 'Demo',
    appFolder: 'app',


    stores: [
        'Components'
    ],
    models: [
        'Section'
    ],
    
    launch: function() {
        var xmlpath;
    
        if (typeof Ion != 'undefined'){
            var result = Ion.io.browseFiles({
                path: Ion.io.userHomePath,
                type: 'open',
                filters: [{
                    name: 'XML Files .xml',
                    pattern: '*.xml'
                }]
            });
            
            if (result.success) {
                this.getStore('Components').proxy.url = result.value;
            }
        }
        else {
            this.getStore('Components').proxy.url = 'data/test.xml';
        }
        
        Ext.create('Ext.container.Viewport', {
            layout: 'fit',
            items: [
                {
                    xtype: 'treepanel',
                    title: 'Users',
                    store: 'Components',
                    useArrows: true,
                    displayField: 'short_text',
                    html: 'List of users will go here'
                }
            ]
        });


        this.getStore('Components').load();
    }
});
conponents.js:

Code:
Ext.define('Demo.store.Components', {    extend: 'Ext.data.TreeStore',
    requires: [
        'Demo.model.Section'
    ],
    model: 'Demo.model.Section',
    autoLoad: false,


    proxy: {
        type: 'ajax',
        url: '',
        reader: {
            type: 'xml',
            root: 'Sections',
            record: '>Section'
        }
    }
});
section.js:

Code:
Ext.define('Demo.model.Section', {    extend: 'Ext.data.Model',


    idProperty: 'id',


    fields: [
        {
            name: 'id',
            mapping: 'ComponentID',
            type: 'string'
        },
        {
            name: 'parent_Id',
            mapping: 'ParentID',
            type: 'string'
        },
        {
            name: 'short_text',
            mapping: 'Text/ShortText',
            type: 'string'
        }
    ]
});
screenshots:

browser:

2013-04-26 12_07_36-Demo.png

desktop packager:

2013-01-01 12_09_38-Demo [built using a trial of Sencha Desktop Packager, expiring on 1_15_2013].png

kind regards

malfurion