1. #1
    Ext JS Premium Member
    Join Date
    Dec 2007
    Posts
    213
    Vote Rating
    0
    sanjshah is on a distinguished road

      0  

    Default XML Reader into a grid

    XML Reader into a grid


    Hi,

    I'm using the my code from v3:

    PHP Code:
        var store = new Ext.data.Store({
            
    url'data/worksample.xml',
            
    reader: new Ext.data.XmlReader({
                   
    record'record',
                   
    id'id'
               
    }, [
                   
    'id''service''actualprogress''plannedprogress''completiondate'
               
    ])
        }); 
    But when I run Firebug I recive an error:

    me.model is undefined

    Any ideas?

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    14
    Vote Rating
    -1
    hellosatya has a little shameless behaviour in the past

      0  

    Default


    You have to define model first :
    Code:
     Ext.define('myModel',{
            extend: 'Ext.data.Model',
            fields: [ 'f1','f2']
        });
    Then add one property in your store :
    Code:
    model:myModel,
    OR --- you can simply define fields in your store before reader.

    Code:
    url : ....,
    fields : [ 'f1','f2'],
    reader : .....
    Give a try

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2007
    Posts
    213
    Vote Rating
    0
    sanjshah is on a distinguished road

      0  

    Default


    hellosatya thanks for replying,

    I'm really confused I thought it was easier in v3, so I need to do this:

    PHP Code:
    Ext.define('myModel',{
            
    extend'Ext.data.Model',
             
    url'data/worksample.xml'
            
    reader: new Ext.data.XmlReader({ 
                   
    record'record'
                   
    id'id' 
               
    }, [ 
                   
    'id''service''actualprogress''plannedprogress''completiondate' 
               
    ]) 
    }); 

    Then how do set this to my grid?

    it was:

    PHP Code:
        var grid Ext.create('Ext.grid.Panel', {
            
    storestore,
    ....... 

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    14
    Vote Rating
    -1
    hellosatya has a little shameless behaviour in the past

      0  

    Default


    Try this :
    Code:
    var store = new Ext.data.Store({ 
            url: 'data/worksample.xml', 
            fields:[
                    'id','service','actualprogress','plannedprogress','completiondate'
           ],
           reader: new Ext.data.XmlReader({ 
                   record: 'record', 
                   id: 'id' 
               }) 
        });  

  5. #5
    Ext JS Premium Member
    Join Date
    Dec 2007
    Posts
    213
    Vote Rating
    0
    sanjshah is on a distinguished road

      0  

    Default


    thanks hellosatya,

    that worked. Just when I got used to the old style I need to learn the new way.

    Regards

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar