I am a newbie in ExtJS4. I am coding the example from the page "http://ift.tt/11sj8Mb". What I dont understand is when defining the store and gridPanel like this:
Ext.define ('AM.store.Users',{
extend:'Ext.data.Store ',
model:'AM.model.User',
data:[{name:'Ed', email:'ed@sencha.com'},{name:'Tommy', email:'tommy@sencha.com'}]
});
Ext.define ('AM.view.user.List',{
extend:'Ext.grid.Panel ',
alias:'widget.userlist',
title:'All Users',// we no longer define the Users store in the `initComponent` method
store:'Users',
initComponent:function(){
this.columns =[...});
1. Why when you define the model property of store, you have to writte the entire class and not just 'User' because when you define the grid, the property store is 'Users' and not the entire class. I have tried to specify just 'User' but tries to get localhost:8080/nameApplication/User.js
Thanks
Specify the entire class in property "model" of Ext.data.Store?
Aucun commentaire:
Enregistrer un commentaire