-
30 Apr 2012 3:34 AM #1
stores /models explanation
stores /models explanation
hello, i start studing sencha, i have seen a lot of tutorials/books.
i currently work on data. could any one explain me what is the role of each clearly?
my point is that on stores you can set fields and store can only have one model.
but on some tutorials it says store can have a lot of models and it's the bucket of all data.
model also take fields that are passed into lists etc...
anyone could pls could explain the role and how to work with them in simple words?
what's the porpose af each?
-
2 May 2012 5:42 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
A Model definition is the fields that will represent your data. So you define your fields in the Model.
The store will always use s model. Either you define the model config and it will use it or you define the fields config on the store and the store will actually create a model for you so it will always use a model.
A model is a single record. A store is a collection of models.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
2 May 2012 6:57 AM #3
so i can add two models on a store? and if so how can i do that in architect. thanx
-
2 May 2012 7:37 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
You cannot use two different model definitions to a store no
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote