-
8 Dec 2011 2:51 AM #1
Operation.commitRecords fails, wrong Ext.util.MixedCollection init?
Operation.commitRecords fails, wrong Ext.util.MixedCollection init?
REQUIRED INFORMATION
Ext version tested:- Touch 2.0-pr2
- Chrome
- I'm working on a store-to-store system for syncing data between localStorage and my rest services.
- Somewhere deep in sencha code a call is made to commitRecords on the operation class:
Code:commitRecords: function (serverRecords) { var me = this, mc, index, clientRecords, serverRec, clientRec; if (!me.actionSkipSyncRe.test(me.action)) { clientRecords = me.records; if (clientRecords && clientRecords.length) { mc = Ext.create('Ext.util.MixedCollection', true, function(r) {return r.getId();}); mc.addAll(clientRecords);- The following line is causing a javascript error
Code:mc = Ext.create('Ext.util.MixedCollection', true, function(r) {return r.getId();});- It (indirectly) calls the constructor of Ext.mixin.Observable and finds that "true" isn't a valid config object.
- The javascript error I get is that you can't use in on a boolean.Code:constructor: function(config) { if (config) { if ('listeners' in config) {
Work around:
Code:// Sencha bug: boolean is not a valid config object Ext.define('Ext.mixin.Hacks', { override: 'Ext.mixin.Observable', constructor: function(config) { if (config && Ext.isObject(config)) { if ('listeners' in config) { ....
-
8 Dec 2011 12:35 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
This issue has already been fixed for the next release.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote