Search code examples
extjscombobox

How to open a drop-down list after cell click


I have a combobox editor in my Name column. Now when I click on a cell, cell becomes active and after that when I click on the trigger, I get a dropdown list. I have "clicksToEdit: 1", but I still have to click one more time to get the dropdown list

Can I make it so that when I click on a cell, a drop-down list appears immediately? I mean, the drop-down list should appear without additionally clicking on the trigger. Immediately after activating the cell Is that possible? please help

This my fiddle https://fiddle.sencha.com/#view/editor&fiddle/3cn9

P.S. Pardon my English.


Solution

  • You could add a focus listener for the combobox and call there the expand function.

    {
        header: 'Name',
        dataIndex: 'name',
        flex: 1,
        editor: {
            xtype: 'combobox',
            editable: false,
            queryMode: 'local',
            displayField: 'name',
            triggerAction: 'all',
            valueField: 'name',
            store: names,
            listeners: {
                focus: function (item) {
                    item.expand();
                }
            }
        }
    }
    

    I extended your fiddle: https://fiddle.sencha.com/#view/editor&fiddle/3cng

    Another possibility would be the a listener for the cellediting plugin, but here you have to analyze the correct cell and editor and handle it accordingly. I think the focus listener of the combobox ist the easiest way.