-
16 Jan 2013 2:11 AM #1
[4.1.3] Tree store triggers 'update' event twice
[4.1.3] Tree store triggers 'update' event twice
Tree store triggers update event only once in 4.1.1a but in 4.1.3 it triggers twice. Is it expected behavior?
Attached zip file containing the JavaScript.
Run the html (modify the src and href in html to point to 4.1.3) which loads the treegrid.js. Click on any tree node to edit it. Modify the contents and press enter. While we were expecting only one alert with 'Updated' message we received two.
Can you please help fixing this issue?Code:var store = Ext.create('Ext.data.TreeStore', { fields : ['name','user'], listeners : { update : function(store, record, operation, modifiedFieldNames, eOpts){ console.log('Updated') } }, root: { expanded: true, children: [ { name: "detention", leaf: true ,user : 'a'}, { name: "homework", expanded: true,user : 'b', children: [ { name: "book report", leaf: true,user : 'c' }, { name: "alegrbra", leaf: true,user : 'd'} ] }, { name: "buy lottery tickets", leaf: true,user : 'e' } ] } }); Ext.create('Ext.tree.Panel', { title: 'Simple Tree', width: 200, height: 150, plugins : [ Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 })], columns : [{ xtype: 'treecolumn', //this is so we know which column will show the tree text: 'Task', flex: 2, sortable: true, editor : 'textfield', dataIndex: 'name' },{ text: 'Assigned To', flex: 1, dataIndex: 'user', sortable: true }], store: store, rootVisible: false, renderTo: Ext.getBody() });
Thanks,
Pompa
-
16 Jan 2013 11:39 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,637
- Vote Rating
- 435
Without using cell editing, you could use this test case to reproduce same behavior as cell editing plugin is only meant for grids:
Code:Even though the cell editor is technically for the grid, so I created the test case below that simplifies it a little. Thanks for the report! I have opened a bug in our bug tracker.
Code:var store = Ext.create('Ext.data.TreeStore', { fields : ['name','user'], listeners : { update : function(store, record, operation, modifiedFieldNames, eOpts){ console.log('Updated') } }, root: { expanded: true, children: [ { name: "detention", leaf: true ,user : 'a'}, { name: "homework", expanded: true,user : 'b', children: [ { name: "book report", leaf: true,user : 'c' }, { name: "alegrbra", leaf: true,user : 'd'} ] }, { name: "buy lottery tickets", leaf: true,user : 'e' } ] } }); Ext.create('Ext.tree.Panel', { title: 'Simple Tree', width: 200, height: 150, columns : [{ xtype: 'treecolumn', //this is so we know which column will show the tree text: 'Task', flex: 2, sortable: true, editor : 'textfield', dataIndex: 'name' },{ text: 'Assigned To', flex: 1, dataIndex: 'user', sortable: true }], store: store, rootVisible: false, renderTo: Ext.getBody(), listeners : { itemclick : function(view, record) { record.set('name', record.get('name') + 1); } } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
16 Jan 2013 10:45 PM #3
Thanks for looking into this bug.
I will be waiting for the fix.
Thanks,
Pompa
You found a bug! We've classified it as
EXTJSIV-8248
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote