1

I am using ext version 6.5.3. classic Neptune. I have a treepanel with cellediting plugin and have provided clicksToEdit as 1. Now if I apply filter on the treepanel and click on the cell to edit, it takes 1 click to do so. But if I click on the next cell, it takes 2 clicks to become editable. Please find the below example

 Ext.create({
        "xtype": "container",
        renderTo: Ext.getBody(),
        "items": [{
            "xtype": "treepanel",
            "id": "tp",
            store: Ext.create('Ext.data.TreeStore', {
                fields: ['Brand', 'Price'],
                root: {
                    children: [{
                        Brand: 'Brand1',
                        Price: '8M'
                    }, {
                        Brand: 'Brand2',
                        Price: '8M'
                    }, {
                        Brand: 'Brand3',
                        Price: '10M'
                    }]
                }
            }),
            "rootVisible": false,
            "columns": [{
                "xtype": "treecolumn",
                "dataIndex": 'Brand',
                "editor": true,
                "text": "Brands"
            }, {
                "xtype": "treecolumn",
                "dataIndex": "Price",
                "text": "Value",
                "editor": true,
            }],
            "plugins": [{
                "ptype": "cellediting",
                "clicksToEdit": 1
            }]
        }, {
            xtype: 'button',
            text: 'Add Filter',
            handler: function () {
                Ext.getCmp('tp').getStore().addFilter({
                    property: 'Price',
                    value: '8M'
                })
            }
        }, {
            xtype: 'button',
            text: 'Clear Filter',
            handler: function () {
                Ext.getCmp('tp').getStore().clearFilter();
            }
        }]
    });

fiddle link

  1. click on "Add Filter" button.
  2. click a cell and edit the cell (do not press enter).
  3. click on the next cell to edit (here it will take 2 clicks for the cell to become editable).
  4. click on "Clear Filter" button to remove filter and perform same steps. (here the 2nd cell will become editable just after single click)

Expected result for step 3, cell should become editable on 1st click itself. This was working on version "6.0.1" and is breaking in "6.5.3".

Is there any workaround available?

Anuja Kori
  • 21
  • 3
  • Your code following the steps works in Sencha Fiddle, I can't reproduce the error. – Peter Koltai Aug 24 '21 at 09:07
  • I have added fiddle link and updated the steps for more clarity. – Anuja Kori Aug 24 '21 at 09:18
  • I see now. Could be an ExtJS bug, only happens when the cell is dirty: if you start editing, add a character but delete it, then it goes to the other cell with one click. And this happens only when filtered, I can't imagine this is intended behaviour. – Peter Koltai Aug 24 '21 at 10:14
  • 1
    right, after thorough investigation I've found that it is coming from **afterEdit** function of Ext.data.TreeStore class. It calls `me.onFilterEndUpdate(me.getFilters());` which is causing the issue. But I' am still looking into what exactly is causing the issue. Will be updating here if I find something, thanks – Anuja Kori Aug 24 '21 at 12:49
  • 2
    Maybe it is not a bug, but a bugfix from earlier versions. When you change a value in a filtered list, it has to reapply filters, it's also possible that the row you were editing is no longer in the list, and therefore ExtJS prevents opening the other cell for editing. Consider using a `rowediting` plugin instead of `cellediting`. – Peter Koltai Aug 24 '21 at 16:57

0 Answers0