Editable tree nodes - not working

264 views Asked by At

I have a tree panel defined like this:

Ext.define('FilesEditor.view.FilesEditorNavigTree',{
    extend:'Ext.tree.Panel',
    ....
    columns:[{
        xtype:'treecolumn',
        header:'test',
        dataIndex:'text',
        editor:{
           xtype:'textfield'
        }

I guess I'm doing something wrong, since nothing happens when I click on tree nodes. Or it is possible, that I should first require somewhere some plugin. BTW. I would rather have this possibility to edit nodes on doubleclick and have a listener for this event.

1

There are 1 answers

0
Jacobian On

The solution was to use a Ext.grid.plugin.CellEditing inside initComponent of the tree panel. So, I did it like this:

Ext.define('FilesEditor.view.FilesEditorNavigTree',{
    extend:'Ext.tree.Panel',
    ...
    initComponent:function(){
        var cellediting = Ext.create('Ext.grid.plugin.CellEditing',{
            clicksToEdit:2
        });
        this.plugins = [];
        this.plugins.push(cellediting);
        this.columns = [{
           xtype:'treecolumn',
           header:'test',
           dataIndex:'text',
           editor:{
              xtype:'textfield'
           },....];
        this.callParent(arguments);