0

I'm really struggling to get my sencha touch application running.

It seems that sencha touch doesn't execute the request to the json file that I have defined inside of the store proxy.

If I switch the proxy for data the list is getting populated by the data. Chrome developer tools don't show any clues that sencha is even trying to get the json file.

The app is hosted by Microsoft IIS (json mime-type is properly configured).

Model:

Ext.define("ACS.model.Test", {
    extend: "Ext.data.Model",
    config: {
        fields: [ "name"]
    }
});

Store:

Ext.define("ACS.store.TestStore", {
    extend: "Ext.data.Store",

    config: {
        model: "ACS.model.Test",
        proxy: {
            autoLoad: true,
            type: "ajax",
            url: "test.json",

            reader: {
                type: "json",
                rootProperty: "test"
            },
        }

        /* data : [
            {name: "Test 1"},
            {name: "Test 2"}
        ]*/
    }
});

View:

Ext.define("ACS.view.TestView",{
    extend: "Ext.Panel",
    xtype: "test",
    requires: [
        "Ext.dataview.List"
    ],

    config: {
        title: "Test",
        iconCls: "team",
        layout: "fit",
        items:[
            {
                xtype: "titlebar",
                title: "Test",
                docked: "top"
            },
            {
                xtype: "list",
                store: "TestStore",
                itemTpl: "Name: {name}"
            }
        ]
    }
});

"test.json"

{
    "test" : [
        {"name" : "Name1"},
        {"name" : "Name2"},
        {"name" : "Name3"},
        {"name" : "Name4"}
    ]
}

1 Answer 1

3

autoLoad is a configuration on the store, not the proxy.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.