[AC-1636] Collection.get returns null when searching by cid
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2015-09-30T03:27:00.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy, Titanium SDK & CLI |
Labels | android, backbone, ios, titanium |
Reporter | Andrés Franco |
Assignee | Shak Hossain |
Created | 2015-05-19T19:17:52.000+0000 |
Updated | 2016-03-08T07:38:07.000+0000 |
Description
Hi, i got this error on Titanium SDK 4.0.0RC4 and RC5.
It happens when you try to get a model on a collection by cid/id, how Backbone deprecated the use of getByCid we have to go this way, but this method is returning null always.
Collection.get('c1') === null.
A test case can be:
Alloy.Collections.cars.reset([{'make':'Honda'}, {'make':'Ford'}]);
// Imagine that we want to get an item by the 'cid' that backbone creates for each item in the collection.
// So if we do that, it returns null. Im using right now getByCid but on Titanium SDK 3.5.1.G.A
// and it works but since Backbone deprecate it.. we have to use the get directly on 4.0.0RC4/5
// If you try to replicate this behaviour with Backbone itself, you´ll see how it works but not on Alloy actually.
Alloy.Collections.cars.get('c1');
Thanks
Hi, Please include a test case .That will be really helpful to address your issue. Thanks
I attached an example. I hope it helps!
Hi, I tested the issue you reported. I can't reproduce it.I tested this using the studio build: 4.1.1.201507141126,Titanium SDK Version:4.1.0.GA,Appcelerator Command-Line Interface, version 4.1.2,alloy 1.7.6 and Node.js Version 0.10.20.I recommend you upgrade SDK to the latest build and let us know if you get the error again. Please include a proper test case and steps to reproduce. Thanks