PDA

View Full Version : tree reload problem..help me.



RedWhale
3 May 2012, 5:33 AM
Hi :)
i wanted to reload when tree expand. so.. I solved.
but, I have a problem.

this is i how solved.


'beforeitemexpand' : function(record) {
if ( record.hasChildNodes() ) {
record.removeAll(); //i think this is cause...
treeStore.load({
node: record
});
}
}


Problem cause is.."record.removeAll();" (my think)

If treeStore record edit.. after call method "treeStore.sync();",
my model proxy twice call....<update> and <destroy>.
but, i don't want to call "destory" !!
it's problem ..help me.


treeCellEditing.addListener('edit', function(o, e) {
treeStore.getProxy().extraParams = {
node: e.record.getId(),
text: e.value
};
treeStore.sync(); //it's problem..twice call. update and destory.
treeStore.getProxy().extraParams = {};
});



It's my treeStrore model.


Ext.define('WFM.model.TreeModel', {
extend: 'Ext.data.Model',
proxy: {
type: 'ajax',
//url : 'TreeAction',
api: {
read: 'TreeAction',
create: 'TreeAction?mode=create',
update: 'TreeAction?mode=update',
destroy: 'TreeAction?mode=remove'
},
reader: {
type: 'json'
},
writer: {
type: 'json'
}
},
fields: [
{name: 'text', type: 'string'},
{name: 'size', type: 'int'}
]
});



p.s
I can speak a little english..i'm sorry..

vietits
3 May 2012, 6:10 PM
It seems you are using Ext 4.0. It's a bug with TreeStore in Ext 4.0. Try to update to Ext 4.1.