Hybrid View

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    5
    Vote Rating
    0
    sannou is on a distinguished road

      0  

    Default Unanswered: populate itemTPL list with sencha touch

    Unanswered: populate itemTPL list with sencha touch


    Hi all.
    i want to display few characteristics of my account object.
    so i thought to use ItemTPL.
    i did like this.
    for my store i put:


    Code:
    Ext.regStore('infocomptes', {
     model: 'infocompte',
     autoLoad: true,
     proxy: 
     {
     type: 'ajax',
     url: 'http://localhost:10000/Service/transactions/67589'
     reader: 
      {
       type: 'json',
      }
     }
    });
    and in my model i put:
    Code:
    
    Ext.regModel('infocompte', {
        fields: ['transactionDATE','transactionNATURE','transactionMANTANT','compteID']
    });
    and in my view i put this:
    Code:
    App.views.Compte = Ext.extend(Ext.List, {
       
    store: 'infocomptes',
    itemTpl: '<div class="date">{transactionDATE}</div> <div class="operations">operation: {transactionNATURE}</div> <div class="money">Mantant: {transactionMANTANT}</div> <div class="money2">compte: {compteID}</div>',
    
    
    });
    Ext.reg('Compte', App.views.Compte);
    but its doesnt display anything. what i should be modified to fix this.

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default


    Put a listener in your ext.list to write in the console your store, something like this:

    console.log(infocomptes)

    And see if the store have data.

    Also, you forgot a comma in the end of the line of your url:

    Code:
    url: 'http://localhost:10000/Service/transactions/67589'
    ,
    reader:
    Good luck

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    5
    Vote Rating
    0
    sannou is on a distinguished road

      0  

    Default


    thank you izak, the error comes from comma ;p thank you

Thread Participants: 1

Tags for this Thread