1. #1
    Sencha User lfs2008's Avatar
    Join Date
    Oct 2010
    Location
    Russia
    Posts
    62
    Vote Rating
    5
    lfs2008 is on a distinguished road

      0  

    Default Proxy in Model issue

    Proxy in Model issue


    Hi all!

    Ia m having an issue with Proxy configured in Model.

    You can find example here http://wap7.ru/folio/ext-model-proxy/index.html?debug

    Code:
      Ext.onReady(function () {
    
    
    
    Ext.define('Company', {
        extend: 'Ext.data.Model',
        fields: [{
            name: 'name'
        }],
        proxy:{
            type:'rest',
            url:'data.json',
            reader:{
                type:'json',
                root:'data'
            }
        }
    });
    
    
    
    
        Ext.create('Ext.grid.Panel', {
            store:Ext.create('Ext.data.JsonStore', {
                model:'Company',
                autoLoad:true
            }),
            columns:[
                {
                    text:'Company name',
                    dataIndex:'name'
                }
            ],
            height:100,
            width:600,
            title:'Proxy  in Model',
            renderTo:'grid-example2'
        });
    });
    buildUrl causes an error in request
    • Uncaught TypeError: Cannot call method 'indexOf' of undefined ext-all-debug.js:5301
      Ext.apply.urlAppend ext-all-debug.js:5301
      Ext.define.buildUrl ext-all-debug.js:26013
      Ext.define.buildRequest ext-all-debug.js:25856
      Ext.define.doRequest ext-all-debug.js:26056
      Ext.define.read ext-all-debug.js:25825
      Ext.define.load ext-all-debug.js:44665
      Base.callParent ext-all-debug.js:2891
      Ext.define.load


    Please give me a hint - what am i missing?

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default use Ext.data.Store()

    use Ext.data.Store()


    Hi Ifs,

    Use Ext.data.Store() instead of JsonStore().
    Code:
     Ext.create('Ext.grid.Panel', { 
           store:Ext.create('Ext.data.Store', {     // use Store() instead of JsonStore()                 model:'Company', 
               autoLoad:true 
           }),
    ....................
    });
    See the working sample example - http://jsfiddle.net/Q67a7/
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User lfs2008's Avatar
    Join Date
    Oct 2010
    Location
    Russia
    Posts
    62
    Vote Rating
    5
    lfs2008 is on a distinguished road

      0  

    Default


    thanks

Thread Participants: 1

Tags for this Thread