View Full Version : [FIXED-272] Ext.data.Reader.extractData() broken in sencha-touch-beta-0.94?

10 Sep 2010, 7:48 AM
Sencha Touch version tested:


Platform tested against:

iOS 4.02


I just tried to upgrade to beta-0.94. I have the following data model:
Ext.regModel('MyModel', {
fields: [ { name: 'name', convert: function (v, record) { return record.user.first + ' ' + record.user.last; } }

This used to work with beta-093. What I observe is that the conversion function is called twice, once with correct arguments via line 7289 (calling this.extractValues(node)), and then with incorrect arguments via line 7293 (calling new Model(values, id)). Obviously, the second call gives a javascript error.

Test Case: The result that was expected:

No error

The result that occurs instead:

Javascript error in the conversion function

Screenshot or Video: Debugging already done: Possible fix:

Jamie Avins
10 Sep 2010, 8:49 AM
Thank you for the report.

15 Sep 2010, 8:54 PM
I don't have enough information here to be able to construct a reliable test case and get you a fix. Could you provide a code sample demonstrating what the error is and how to reproduce it?

24 Sep 2010, 1:53 PM
Bumping for some additional information.

29 Sep 2010, 6:49 AM
I ran into this error as well in v0.95. On the first call rec is an Element and on the second call it is an Object.
Here's my quick and dirty work around.

Ext.regModel('StoredFilter', {
fields: [
{name: 'id'},
{name: 'name'},
{name: 'delete', mapping: 'policy/delete'},
{name: 'edit', mapping: 'policy/edit'},
{name: 'edit_policy', mapping: 'policy/edit_policy'},
{name: 'filterXml', convert: function(v, rec){
var retval = v;

// Workaround for bug in Sencha Touch 0.95
if (rec.ownerDocument) {
retval = Ext.DomQuery.selectNode('data', rec)

return retval;

29 Sep 2010, 9:15 AM
I'd love to be able to address this but I really don't have enough information to reproduce the problem. If you can provide a full test case that demonstrates the problem I'll happily work on a fix asap.

This thread (http://www.sencha.com/forum/showthread.php?104623-Posting-to-the-bug-forum) has a template bug report which contains all of the information we need to address bugs.

29 Sep 2010, 9:08 PM
I reproduced the problem with below code using Sencha Touch 0.95.
This code shows "convert/convert/Conan" in List.
but It should be "convert/Conan"?

onReady : function() {
Ext.regModel('Person', {
fields: [
name: 'name',
convert: function(v, rec) {
return "convert/" + v;

new Ext.List({
fullscreen: true,
tpl: '<tpl for="."><div class="person">{name}</div></tpl>',
itemSelector: 'div.person',
singleSelect: true,
store: new Ext.data.Store({
model: 'Person',
proxy: {
type: 'ajax',
url : '/OPEN-272/users.json',
reader: {
type: 'json',
root: 'rows'
autoLoad: true

users.json contents:

"rows": [
"name" : "Conan"

30 Sep 2010, 10:42 AM
Thanks for the test case, I have confirmed and fixed the bug (convert is called internally by Model now so the call from inside Reader was removed). This just made it in to the 0.96 release, which is just about to drop.