-
19 Nov 2011 8:45 PM #1
Calling 'deselect' on a list results in an error
Calling 'deselect' on a list results in an error
Even after fixing the bug causing the error, deselect still doesn't work.
Here's the error:
Changing line 20658 in sencha-touch-all-debug-w-comments.js from this:Code:Error
- line: 20658
- message: "'undefined' is not an object (evaluating 'me.store.getAt')"
- sourceId: 4459808320
- sourceURL: "http://dev.lylepratt.com/app/load/core/sencha-touch-all-debug-w-comments.js"
- __proto__: Error
to this:Code:records = [me.store.getAt(records)];
seems to cause the error to go away, but the deselection still does not occur.Code:records = [me.getStore().getAt(records)];
Twitter: lylepratt
-
21 Nov 2011 9:17 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Can you provide more details as to the code used which caused the error so we can reproduce it?
-
21 Nov 2011 9:21 AM #3
My apologies for not providing more information originally. I'll mock up an example when I get back to a computer.
Twitter: lylepratt
-
21 Nov 2011 10:25 AM #4
Hmm. Well. I'm having trouble reproducing the Error I mentioned above, but deselect() still seems to have issues when passing a list index. I guess I was doing something wrong at the time to produce the error.
deselect() isn't working when you pass the list index. It DOES work when you pass a store record. The documentation states that you can pass the list index.
Here is some code as an example:
Code:Ext.application({ name: 'app', controllers: [], launch: function() { console.log('app launch'); Ext.regModel('Contact', { fields: ['firstName', 'lastName'] }); var store = new Ext.data.JsonStore({ model: 'Contact', sorters: 'lastName', getGroupString: function(record) { return record.get('lastName')[0]; }, data: [ {firstName: 'Tommy', lastName: 'Maintz'}, {firstName: 'Rob', lastName: 'Dougan'}, {firstName: 'Ed', lastName: 'Spencer'}, {firstName: 'Jamie', lastName: 'Avins'}, {firstName: 'Aaron', lastName: 'Conran'}, {firstName: 'Dave', lastName: 'Kaneda'}, {firstName: 'Jacky', lastName: 'Nguyen'}, {firstName: 'Abraham', lastName: 'Elias'}, {firstName: 'Jay', lastName: 'Robinson'}, {firstName: 'Nigel', lastName: 'White'}, {firstName: 'Don', lastName: 'Griffin'}, {firstName: 'Nico', lastName: 'Ferrero'}, {firstName: 'Nicolas', lastName: 'Belmonte'}, {firstName: 'Jason', lastName: 'Johnston'} ] }); var list = new Ext.List({ fullscreen: true, itemTpl: '<div class="contact">{firstName} <strong>{lastName}</strong></div>', store: store }); list.on('itemtap', function(list, index) { setTimeout(function() { list.deselect(index); console.log('Passing a list index does NOT work and also does not produce an error: '+index) }, 1000); setTimeout(function() { var record = store.getAt(index); list.deselect(record); console.log('But passing a record seems to work fine: '+index) }, 3000); }); } });Twitter: lylepratt
-
21 Nov 2011 11:16 AM #5Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Fair enough, I'll check into it.
-
21 Nov 2011 2:31 PM #6Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
This issues has been fixed for the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1074
in
2.0.


Reply With Quote