1. #1
    Ext User
    Join Date
    Feb 2008
    Posts
    2
    Vote Rating
    0
    phxx is on a distinguished road

      0  

    Default Ext.data.store works / Ext.data.JsonStore doesn't work

    Ext.data.store works / Ext.data.JsonStore doesn't work


    Hi together,

    I've played a bit with the Store and the JsonStore class to load a JSON Object trough the ScriptTagProxy. But i cannot use the JsonStore class, because it fails. Storage works greater.

    Here is the Code:
    Code:
        var store = new Ext.data.Store({
            proxy: new Ext.data.ScriptTagProxy({
                url: 'http://localhost:8000/jazzy/bookmarks/get/'
            }),
            reader: new Ext.data.JsonReader({
                root: 'bookmarks',
                id: 'id'
            }, [
                {name: 'name', mapping: 'name'},
                {name: 'url', mapping: 'url'},
                {name: 'creator', mapping: 'creator', type: 'int'},
            ])
        });
    works fine.
    Code:
        var store = new Ext.data.JsonStore({
            proxy: new Ext.data.ScriptTagProxy({
                url:"http://localhost:8000/jazzy/bookmarks/get/"
            }),
            root: 'bookmarks',
            fields: [
                'name', 'url',
                {name:'creator', type: 'int'},
            ]
        });
    doesn't work for me. My Firebug says:
    Code:
    url has no properties
    [Break on this error] url += (url.indexOf('?') != -1 ? '&' : '?') + '_dc=' + (new Date...
    May anyone help me?

    Thanks, phxx

  2. #2
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    0
    devnull has a little shameless behaviour in the past

      0  

    Default


    for whatever reason, jsonStore seems to be broken in many situations so I would recommend going with your first solution (thats what I always use as well).

  3. #3
    Ext User
    Join Date
    Feb 2008
    Posts
    2
    Vote Rating
    0
    phxx is on a distinguished road

      0  

    Default


    Ok, though it's more a bug than the stupidity of me? :-)

Thread Participants: 1