PDA

View Full Version : ExtJS 4.2.2 TreeStore getUpdatedRecords() returns all records.



xjscrafter
10 Nov 2014, 3:12 PM
Our ExtJS 4.2.2 app has a tree panel and the tree stotre getUpdatedRecords() method is returning all rows, not just those that changed.

I have defined an idProperty on the model.

What else could be causing this?

xjscrafter
10 Nov 2014, 5:06 PM
Can anyone shed light on this?

joel.watson
12 Nov 2014, 11:37 AM
Hi xjscrafter--

Can you share the configuration for your tree/store?

Thanks!

xjscrafter
13 Nov 2014, 8:54 AM
Tree and model. We use setRootNode() after getting data from backend to set tree contents.


Ext.define('MyTreeSelector', {
extend: 'Ext.tree.Panel',
alias: 'widget.myTreeSelector',
useArrows: true,
multiSelect: true,
singleExpand: false,
rootVisible: false,
itemId: 'detailTree',
flex: 1,
scroll: true,
sortableColumns: false,
border: false,


store: Ext.create('Ext.data.TreeStore', {
model: 'MyTreeModel',
root: {
"expanded": true,
"children": []
}
}),
columns: [{
xtype: 'treecolumn',
text: "My Column",
flex: 1,
sortable: false,
dataIndex: 'text'
}]
});


Ext.define('MyTreeModel', {
extend: 'Ext.data.TreeModel',
proxy: {
type: 'memory'
},
idProperty: "uuid",
fields: [
{ name: 'text' },
{ name: 'uuid' }
]
});

joel.watson
14 Nov 2014, 7:29 AM
Can you take a look at this fiddle? https://fiddle.sencha.com/#fiddle/de1

When I follow your instructions for setting the root node, editing a record, and then calling getUpdatedRecords(), I only get the one modified record returned.

Thanks