Hybrid View
-
18 Mar 2013 6:35 AM #1
Data package differences in ExtJS and Sencha Touch
Data package differences in ExtJS and Sencha Touch
Until today i was convinced that data package is shared between ExtJS and Sencha Touch, but i realized it's not. Since it'd be a hard work to browse all the documentation/code to just write down all the differences, could you provide me with a short summary? I'd be also nice to know why it's not shared.
-
20 Mar 2013 6:51 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
The biggest difference is the config object system that Touch uses but Ext JS does not. For instance, this is how you define a model in Ext JS:
But in Touch it should be:Code:Ext.define('MyModel', { extend : 'Ext.data.Model', fields : ['foo', 'bar'] });
Code:Ext.define('MyModel', { extend : 'Ext.data.Model', config : { fields : ['foo', 'bar'] } });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.
-
20 Mar 2013 7:01 AM #3
Does it mean that my ExtJS model cannot be simply reused if i want to write touch interface for my application?
-
20 Mar 2013 7:05 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
Not out of the box for Ext JS 4 and ST 2
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.
-
20 Mar 2013 7:10 AM #5
Oh well, thanks for your answers. Two questions remain for me.
1. As i already asked, what's the reasoning behind this? Thinking about it, i can't find a reason why not to share data package, but i don't know ST at all.
2. Is it a subject to change in the future?
-
20 Mar 2013 11:26 AM #6
well, you can use it for both in case you do not put anything inside config but on class level. sencha touch will copy it over to config, but you will get lots of deprecated messages.
if you use config it will break for ext js.
if you try to create own logic to put the configs into the config object in case it is touch, you will still get those messages, because the sencha copying logic gets applied as an override as well and probably get executed before your own changes.
best regards
tobiu


Reply With Quote