anderfsilva
29 Nov 2011, 8:57 AM
The code as is works fine, but when I remove the "root: date" and uncomment the block that performs the query on the server it duplicates my list displaying twice "Drinks". I noticed that it makes twice requisitions the server.
Someone knows why does it makes two requests and duplicate the list?
Ext.application({
launch : function() {
var data = {
items : [{
text : 'Drinks',
items : [{
text : 'Water',
items : [{
text : 'Sparkling',
leaf : true
}, {
text : 'Still',
leaf : true
}]
}, {
text : 'Coffee',
leaf : true
}]
}]
};
Ext.regModel('model', {
fields : [{
name : 'text',
type : 'string'
}]
});
var store = new Ext.data.TreeStore({
model : 'model',
defaultRootProperty : 'items',
root : data
// proxy : {
// type : 'jsonp',
// url : 'http://192.168.0.4:9000/',
// reader : {
// type : 'json'
// }
// }
});
Ext.create('Ext.NestedList', {
fullscreen : true,
title : 'Menu',
displayField : 'text',
store : store
});
}
});
tks
Someone knows why does it makes two requests and duplicate the list?
Ext.application({
launch : function() {
var data = {
items : [{
text : 'Drinks',
items : [{
text : 'Water',
items : [{
text : 'Sparkling',
leaf : true
}, {
text : 'Still',
leaf : true
}]
}, {
text : 'Coffee',
leaf : true
}]
}]
};
Ext.regModel('model', {
fields : [{
name : 'text',
type : 'string'
}]
});
var store = new Ext.data.TreeStore({
model : 'model',
defaultRootProperty : 'items',
root : data
// proxy : {
// type : 'jsonp',
// url : 'http://192.168.0.4:9000/',
// reader : {
// type : 'json'
// }
// }
});
Ext.create('Ext.NestedList', {
fullscreen : true,
title : 'Menu',
displayField : 'text',
store : store
});
}
});
tks