-
17 Apr 2013 7:33 AM #1
Proxy SQL not persisted fields bug
Proxy SQL not persisted fields bug
REQUIRED INFORMATION
Senha Touch version tested:- 2.1.0
- 2.2.0rc
Browser versions tested against:- Chrome 25
Description:- SQL proxy create not persisted fields on database.
Steps to reproduce the problem:- Create a model configured to proxy SQL and with a field seted to persist: false.
- Create a dataview to show this model.
The result that was expected:- Don't create "No persisted fields" in database.
The result that occurs instead:- "No persisted" fields being created on database.
Test Case:- Not provided.
HELPFUL INFORMATION
Possible fix:
Code:Ext.define('Appname.util.proxySQL', { override: 'Ext.data.proxy.SQL', getSchemaString: function() { var me = this, schema = [], model = me.getModel(), idProperty = model.getIdProperty(), fields = model.getFields().items, uniqueIdStrategy = me.getUniqueIdStrategy(), ln = fields.length, i, field, type, name; for (i = 0; i < ln; i++) { field = fields[i]; type = field.getType().type; name = field.getName(); if (!field.getPersist()) { continue; } if (name === idProperty) { if (uniqueIdStrategy) { type = me.convertToSqlType(type); schema.unshift(idProperty + ' ' + type); } else { schema.unshift(idProperty + ' INTEGER PRIMARY KEY AUTOINCREMENT'); } } else { type = me.convertToSqlType(type); schema.push(name + ' ' + type); } } return schema.join(', '); } });
-
17 Apr 2013 9:36 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Can I get a simple test case to reproduce?
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.
-
17 Apr 2013 11:22 AM #3
Code:Ext.define('MyModel', { extend: 'Ext.data.Model', config: { fields : [ { name: 'code', type: 'int' }, { name: 'value', type: 'float', persist: false } ] } }); Ext.Viewport.add({ xtype: 'dataview', itemTpl: 'code', store: { model: 'MyModel', proxy: 'sql', autoLoad: true } });
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote