stan229
11 Nov 2011, 9:27 AM
REQUIRED INFORMATION Ext version tested:
Sencha Touch 2.0 rev PR2
Browser versions tested against:
Chrome 15
Safari 5
DOCTYPE tested against:
html
Description:
When having a Grouped list backed by a REST proxy, it does not function.
It throws an error.
When there is data hardcoded into the store it's fine.
Digging through the source it looks like it tries to attach header to the list's DOM items that have not been rendered yet.
Steps to reproduce the problem:
Create grouped list
Call store.load() on grouped list's store.
The result that was expected:
List would render fine
The result that occurs instead:
Loading mask keeps spinning, nothing gets rendered
Error gets thrown:
. Uncaught TypeError: Cannot call method 'insertFirst' of null
. Ext.define.doAddHeadersencha-touch-all-debug.js:44659
. Ext.define.findGroupHeaderIndicessencha-touch-all-debug.js:44651
. Ext.define.doRefreshHeaderssencha-touch-all-debug.js:44385
. Ext.define.doFiresencha-touch-all-debug.js:12851
. Ext.define.firesencha-touch-all-debug.js:12777
. Ext.define.doDispatchEventsencha-touch-all-debug.js:18568
. Ext.define.dispatchEventsencha-touch-all-debug.js:18539
. Ext.define.doFireEventsencha-touch-all-debug.js:21070
. Ext.define.fireEventsencha-touch-all-debug.js:21040
. Ext.define.loadRecordssencha-touch-all-debug.js:26966
. Ext.define.onProxyLoadsencha-touch-all-debug.js:26727
. Ext.define.processResponsesencha-touch-all-debug.js:22715
. (anonymous function)sencha-touch-all-debug.js:25310
. Ext.apply.callbacksencha-touch-all-debug.js:5774
. Ext.define.onCompletesencha-touch-all-debug.js:22073
. Ext.define.onStateChangesencha-touch-all-debug.js:22024
. (anonymous function)sencha-touch-all-debug.js:1964
Test Case:
Ext.define('SuperQualifier.model.Borrower', {
extend : 'Ext.data.Model',
fields : [{
name : "id",
type : "int"
}, {
name : "lastName",
type : "string"
}, {
name : "firstName",
type : "string"
}],
proxy : {
type : "rest",
url : '../borrower/getBorrowers',
reader : {
type : 'json'
}
}
})
//Store
Ext.define('SuperQualifier.store.Borrowers', {
extend : 'Ext.data.Store',
model : 'SuperQualifier.model.Borrower',
requires : ['SuperQualifier.model.Borrower'],
getGroupString : function(record) {
return record.get('lastName')[0];
},
sorters : 'lastName',
// data : [{
// "class" : "com.breakpoint.Borrower",
// "id" : 1,
// "dateCreated" : "2011-11-02T05:26:32Z",
// "firstName" : "Testfirst",
// "lastName" : "Testlast",
// "lastUpdated" : "2011-11-02T05:26:32Z",
// "qualifiers" : []
// }]
});
//List
Ext.define('SuperQualifier.view.BorrowerList', {
extend : 'Ext.List',
xtype : 'borrowerlist',
config : {
store : 'Borrowers',
itemTpl : '<div class="contact"><strong>{firstName}</strong> {lastName}</div>',
grouped : true,
indexBar : true
}
});
Ext.setup({
onReady : function() {
Ext.create('SuperQualifier.view.BorrowerList', {
fullscreen : true,
store : Ext.create('SuperQualifier.store.Borrowers'),
listeners : {
show : function() {
this.getStore().load({
params : {
id : 1
}
});
}
}
});
}
});
HELPFUL INFORMATION Debugging already done:
Through chrome debugger
Possible fix:
Load data through Ext.Ajax.request
Populate store's data
Additional CSS used:
only default ext-all.css
custom css (include details)
Operating System:
Mac OSX 10.7.2
Sencha Touch 2.0 rev PR2
Browser versions tested against:
Chrome 15
Safari 5
DOCTYPE tested against:
html
Description:
When having a Grouped list backed by a REST proxy, it does not function.
It throws an error.
When there is data hardcoded into the store it's fine.
Digging through the source it looks like it tries to attach header to the list's DOM items that have not been rendered yet.
Steps to reproduce the problem:
Create grouped list
Call store.load() on grouped list's store.
The result that was expected:
List would render fine
The result that occurs instead:
Loading mask keeps spinning, nothing gets rendered
Error gets thrown:
. Uncaught TypeError: Cannot call method 'insertFirst' of null
. Ext.define.doAddHeadersencha-touch-all-debug.js:44659
. Ext.define.findGroupHeaderIndicessencha-touch-all-debug.js:44651
. Ext.define.doRefreshHeaderssencha-touch-all-debug.js:44385
. Ext.define.doFiresencha-touch-all-debug.js:12851
. Ext.define.firesencha-touch-all-debug.js:12777
. Ext.define.doDispatchEventsencha-touch-all-debug.js:18568
. Ext.define.dispatchEventsencha-touch-all-debug.js:18539
. Ext.define.doFireEventsencha-touch-all-debug.js:21070
. Ext.define.fireEventsencha-touch-all-debug.js:21040
. Ext.define.loadRecordssencha-touch-all-debug.js:26966
. Ext.define.onProxyLoadsencha-touch-all-debug.js:26727
. Ext.define.processResponsesencha-touch-all-debug.js:22715
. (anonymous function)sencha-touch-all-debug.js:25310
. Ext.apply.callbacksencha-touch-all-debug.js:5774
. Ext.define.onCompletesencha-touch-all-debug.js:22073
. Ext.define.onStateChangesencha-touch-all-debug.js:22024
. (anonymous function)sencha-touch-all-debug.js:1964
Test Case:
Ext.define('SuperQualifier.model.Borrower', {
extend : 'Ext.data.Model',
fields : [{
name : "id",
type : "int"
}, {
name : "lastName",
type : "string"
}, {
name : "firstName",
type : "string"
}],
proxy : {
type : "rest",
url : '../borrower/getBorrowers',
reader : {
type : 'json'
}
}
})
//Store
Ext.define('SuperQualifier.store.Borrowers', {
extend : 'Ext.data.Store',
model : 'SuperQualifier.model.Borrower',
requires : ['SuperQualifier.model.Borrower'],
getGroupString : function(record) {
return record.get('lastName')[0];
},
sorters : 'lastName',
// data : [{
// "class" : "com.breakpoint.Borrower",
// "id" : 1,
// "dateCreated" : "2011-11-02T05:26:32Z",
// "firstName" : "Testfirst",
// "lastName" : "Testlast",
// "lastUpdated" : "2011-11-02T05:26:32Z",
// "qualifiers" : []
// }]
});
//List
Ext.define('SuperQualifier.view.BorrowerList', {
extend : 'Ext.List',
xtype : 'borrowerlist',
config : {
store : 'Borrowers',
itemTpl : '<div class="contact"><strong>{firstName}</strong> {lastName}</div>',
grouped : true,
indexBar : true
}
});
Ext.setup({
onReady : function() {
Ext.create('SuperQualifier.view.BorrowerList', {
fullscreen : true,
store : Ext.create('SuperQualifier.store.Borrowers'),
listeners : {
show : function() {
this.getStore().load({
params : {
id : 1
}
});
}
}
});
}
});
HELPFUL INFORMATION Debugging already done:
Through chrome debugger
Possible fix:
Load data through Ext.Ajax.request
Populate store's data
Additional CSS used:
only default ext-all.css
custom css (include details)
Operating System:
Mac OSX 10.7.2