2014-01-23 36 views
1

我得到以下錯誤,當我運行我的應用程序:[WARN] [UniSelect.view.ListeClient#applyStore]指定的商店無法找到SenchaTouch 2.3 - 指定的商店無法找到

App.js

Ext.application({ 
name: 'UniSelect', 

requires: [ 
    'Ext.MessageBox', 
], 

views: ['Main', 'ListeClient',], 

model: [ 
     'ListeClient' 
    ], 

store: ['ListeClient'], 

controller: ['controleur'], 

Main.js

Ext.define('UniSelect.view.Main', { 
extend: 'Ext.tab.Panel', 
xtype: 'main', 
requires: [ 
    'Ext.TitleBar', 
    'Ext.Video', 
    'UniSelect.store.ListeClient', 
], 
config: { 
    tabBarPosition: 'bottom', 

    items: [ 
     { 
      title: 'Welcome', 
      iconCls: 'home', 

      styleHtmlContent: true, 
      scrollable: true, 

      items: { 
       docked: 'top', 
       xtype: 'titlebar', 
       title: 'Liste des clients corporatifs' 
      }, 

      html: [ 
       "You've just generated a new Sencha Touch 2 project. What you're looking at right now is the ", 
       "contents of <a target='_blank' href=\"app/view/Main.js\">app/view/Main.js</a> - edit that file ", 
       "and refresh to change what's rendered here." 
      ].join("") 
     }, 
     { 
      xtype: 'listeClient', 
      store: 'listeClient', 
      grouped: true 

     } 
    ] 
} 
}); 

主/ ListeClient.js

Ext.define('UniSelect.view.ListeClient', { 
extend: 'Ext.List', 
xtype: 'listeClient', 

config: { 

    store: 'UniSelect', 

    title: 'Produits', 

    itemTpl: '{matriculeClient}' 

} 


}); 

店/ ListeClient.js

Ext.define('UniSelect.store.ListeClient', { 
extend : 'Ext.data.Store', 

config : { 
    storeId: 'listeClient', 

    model : 'UniSelect.model.ListeClient', 

    grouper : { 
     sortProperty : 'prenomClient', 
     groupFn : function(record) { 
      return record.get('prenomClient').substring(0, 1); 
     } 
    }, 

    sorters : [ { 
     property : 'prenomClient', 
     direction : 'ASC' 
    }, { 
     property : 'nomClient', 
     direction : 'ASC' 
    } ], 

    data : [ { 
     "matriculeClient" : "c001", 
     "prenomClient" : "Guy", 
     "nomClient" : "Belanger", 
     "nbJourRabais" : "7", 
     "nbJourEcheance" : "17", 
     "nbJourRetard" : "0" 
    }, { 
     "matriculeClient" : "c001", 
     "prenomClient" : "Guy", 
     "nomClient" : "Belanger", 
     "nbJourRabais" : "7", 
     "nbJourEcheance" : "17", 
     "nbJourRetard" : "0" 
    }, { 
     "matriculeClient" : "c001", 
     "prenomClient" : "Guy", 
     "nomClient" : "Belanger", 
     "nbJourRabais" : "7", 
     "nbJourEcheance" : "17", 
     "nbJourRetard" : "0" 
    }, { 
     "matriculeClient" : "c001", 
     "prenomClient" : "Guy", 
     "nomClient" : "Belanger", 
     "nbJourRabais" : "7", 
     "nbJourEcheance" : "17", 
     "nbJourRetard" : "0" 
    }, { 
     "matriculeClient" : "c001", 
     "prenomClient" : "Guy", 
     "nomClient" : "Belanger", 
     "nbJourRabais" : "7", 
     "nbJourEcheance" : "17", 
     "nbJourRetard" : "0" 
    }, { 
     "matriculeClient" : "c001", 
     "prenomClient" : "Guy", 
     "nomClient" : "Belanger", 
     "nbJourRabais" : "7", 
     "nbJourEcheance" : "17", 
     "nbJourRetard" : "0" 
    }] 
} 
}); 

型號/ ListeClient.js

Ext.define('UniSelect.model.ListeClient', { 
extend: 'Ext.data.Model', 

config: { 
    fields: [ 
     { name: 'matriculeClient', type: 'auto' }, 
     { name: 'prenomClient', type: 'auto' }, 
     { name: 'nomClient', type: 'auto' }, 
     { name: 'nbJourRabais', type: 'auto' }, 
     { name: 'nbJourEcheance', type: 'auto' }, 
     { name: 'nbJourRetard', type: 'auto' } 

    ] 
} 
}); 

我只是不明白爲什麼SenchaTouch是無法加載我的商店。在我以前的SenchTouch應用程序中,我使用了相同的應用程序結構。

任何人都可以幫助我嗎?

謝謝:)

回答

1

你給商店storeId: 'listeClient',但你給STOREID在列表(ListeClient.js)UniSelect

因此改變store: 'UniSelect',store: 'listeClient',在ListeClient.js

商店它可以是一個存儲實例或商店編號。

see docs

相關問題