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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi