PDA

View Full Version : Nested list is breaking after upgrade to 0.96



blessan
1 Oct 2010, 12:56 AM
Basically my nestedlist is breaking when I try to tap and panel and the getDetailCard is called.
The error is Uncaught TypeError: Cannot read property 'parentNode' of undefined.


I am not sure what i should change as it worked on in the 0.95 version. After this error occurs the back button does not render. Here is a small demo that shows the same problem. Its basically 1 item and when u click on it, a form panel is shown.

What should I add to correct this issue?



Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady : function() {
formPanel = new Ext.form.FormPanel({
scroll:'vertical',
items:[
{
xtype: 'textfield',
label:'First Name',
name : 'maxdaysuserbook'

},
{
xtype: 'textfield',
label:'Last Name',
name : 'userbook'

}]
});


adminStoreData = [
{ text: 'Form',
leaf: true,
iconCls:'book_small',
groupCls:'noSelect'
}];

Ext.regModel('adminStore', {
fields: [
{name: 'text', type: 'string'},
{name: 'iconCls', type: 'string'},
{name: 'groupCls', type: 'string'}
]
});

adminStore = new Ext.data.TreeStore({
model: 'adminStore',
root: {
items: adminStoreData
},
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
}
});

bookSettings = new Ext.NestedList({
backText:'Back',
useTitleAsBackText :false,
fullscreen: true,
cls:'adminPanel',
title: 'ADMIN',
store: adminStore,
getItemTextTpl: function() {
return '<div class="adminListItem {groupCls}"><div class="adminListIcon {iconCls}"></div><div class="adminListText">{text}</div></div>';
},
getDetailCard: function(record, parentRecord) {
module = record.attributes.record.raw.module;
item = record.attributes.record.raw.text;
return formPanel;
}
});
}
});

aconran
1 Oct 2010, 9:29 AM
Hrm, not much changed here between 0.95 and 0.96.

Is the adminStore being populated correctly? Does the 0.95 code work with this exact source code or has something changed on the back end as well?

blessan
3 Oct 2010, 8:10 PM
It works fine when I change to the 0.95 code. I think the code to create the back button is causing the trouble. Is this a bug?

aconran
4 Oct 2010, 9:04 AM
It works fine when I change to the 0.95 code. I think the code to create the back button is causing the trouble. Is this a bug?

Possibly, could you create the simplest test case that still breaks for us to troubleshoot it?

blessan
4 Oct 2010, 7:49 PM
Your example causes the problem. here the link
http://dev.sencha.com/deploy/touch/examples/nestedlist/

Ive already posted a bug
http://www.sencha.com/forum/showthread.php?111424-OPEN-387-Nested-list-is-breaking-0.96&p=520439#post520439