1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    10
    Vote Rating
    0
    hawk_turner is on a distinguished road

      0  

    Lightbulb EditorGrid + Combobox expansion in a single click

    EditorGrid + Combobox expansion in a single click


    Hello,
    I have an editor grid with a combobox for one column. By default, it looks like in order to show the list of options in the combobox, a user has to click once to activate the editor and show the combobox, and then click again to open the combobox list so that they can select an option. I would like to have this only require a single click. My ideas are to:
    a) show the combobox on mouseover for the cells
    or
    b) auto-expand the dropdown list when the user clicks a cell to show the combobox editor

    I would prefer option (a), but are either of these possible? I have searched the forums a lot, and tried a few different ways of adding a listener to the combobox to call the expand() method after it is shown, but it did not work. Any other ideas?

  2. #2
    Ext User
    Join Date
    Dec 2007
    Posts
    10
    Vote Rating
    0
    hawk_turner is on a distinguished road

      0  

    Default


    By "did not work", I mean that either nothing happened, or the combobox did not get auto-expanded and I would get a javascript error when trying to expand it manually. I saw in another post that changing the expanded status manually like this can cause problems with its internal state.

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    82
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      1  

    Default


    For option b you could try:
    Code:
    editor: new Ext.grid.GridEditor(new Ext.form.ComboBox({
      ...
    }), {
      listeners: {
        startedit: function(){
          this.field.expand();
        }
      }
    })
    Option a is not really possible. The only other solution is to show editor for all fields (see my EditableGrid user extension), but that should only be used on very small grids.

  4. #4
    Ext User
    Join Date
    Dec 2007
    Posts
    10
    Vote Rating
    0
    hawk_turner is on a distinguished road

      0  

    Default


    Thanks for the reply. I tried your suggestion, but it didn't seem to change the behavior -- I click once to show the dropdown, then need to click a second time to expand the dropdown list. I'm using the IconCombo class too. Would there be any issues with this?

    The following is what I have:
    Code:
    editor: new Ext.grid.GridEditor(
       ...
       new Ext.ux.IconCombo({ 
          forceSelection: true, 
          triggerAction: 'all', 
          lazyRender: true, 
          mode: 'local',
          editable: false 
          ...
       }), 
       { 
          listeners: { startedit: function(){ this.field.expand(); } } 
       }
    )

Similar Threads

  1. [Solved] Loading Combobox entries on new row in EditorGrid via click only
    By tanepiper in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 16 Aug 2010, 3:20 PM
  2. both single click and double click get fired
    By bhomass in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Nov 2009, 6:39 PM
  3. single-click vs double-click dilemma
    By junkzilla in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 9 Oct 2008, 9:07 AM
  4. Question on double click and single click event handlers within grid
    By NotChris in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 27 Feb 2008, 11:51 AM
  5. Grid - Single click vs Double click select
    By amackay11 in forum Ext 1.x: Help & Discussion
    Replies: 13
    Last Post: 4 Jun 2007, 5:16 PM

Thread Participants: 1