[CLOSED] Combobox click arrow down not fire

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Combobox click arrow down not fire

    Hi all,

    i need to intercept click on arrow down button of combobox.
    I tried IconClick, IndicatorIconClick and TriggerClick directevents without success.
    The only event which fire when i click is BeforeQuery, but it's fire also when i finish to type something in combobox and in my case is not acceptable because i need to open a search window.

    Any suggestions?

    Thanks.
    Last edited by Daniil; Oct 22, 2013 at 2:44 PM. Reason: [CLOSED]
  2. #2
    Hi @infonext,

    There is no event in API to be fired on a trigger click.

    Maybe, the Expand event can meed your requirement.
  3. #3
    Hi Daniil,

    thanks for your answer, but my combo is initially empty, then expand method not fire.
    Probably a workaround is to add an empty string object. It's right?
  4. #4
    Could you, please, describe the requirement in details? Maybe, there is a better solution.
  5. #5
    Hi Danil,

    my target is to open a window on combobox click or if the user leave the field with "TAB" button.
    Initially the combobox and related store is empty.
    If a user enter a value in combobox and press "TAB" or click drop down icon, a window is opened with a page for search an item and the text value of the combobox is passed to the new window like a filter.

    see image1 and image2.
    Click image for larger version. 

Name:	image1.png 
Views:	14 
Size:	21.4 KB 
ID:	7043Click image for larger version. 

Name:	image2.png 
Views:	17 
Size:	34.3 KB 
ID:	7044

    Then the user start the search and if get a value with double-click on value closes the window and combobox is filled with this value (i add this element to the store)

    With expand event i need to add an empty value to combobox before, but the expand is not a good choice because i can get this event wrongly, for example if i press down key or if i type any key after i have filled the combobox with select value.
    I also tried with beforequery, but is not good because the window opens when a i finish to type something in combobox.

    I also tried with TriggerField and work well, but i need to visualize a value in the field and use another value (like DisplayField and ValueField of combobox).
    So i tried to set Tag value of TriggerField with this instruction on double-click of opened window

    parent.Ext.getCmp(getParameterByName('caller')).setTag(rec.COMU_ID)
    but if i try to get this value on a DirectEvent, this value is null.

    Can you help me?

    Thanks
  6. #6
    Hello!

    I think in your case it will be easier to use TriggerField in combination with Hidden field to save value and send it to the server.
  7. #7
    Hi Baidaly,

    thanks for your answer.
    But I need some controls like this on my page.
    So I thought to add an Hidden field to properties of combobox (currently i use an extended version of combobox) for my needs.
    You think that there could be problems?


    Thanks
  8. #8
    To catch a click on a ComboBox's trigger, you could override the onTriggerClick method. Here is the original version.
    Ext.form.field.ComboBox.override({
        onTriggerClick: function() {
            var me = this;
            if (!me.readOnly && !me.disabled) {
                if (me.isExpanded) {
                    me.collapse();
                } else {
                    me.onFocus({});
                    if (me.triggerAction === 'all') {
                        me.doQuery(me.allQuery, true);
                    } else if (me.triggerAction === 'last') {
                        me.doQuery(me.lastQuery, true);
                    } else {
                        me.doQuery(me.getRawValue(), false, true);
                    }
                }
                me.inputEl.focus();
            }
        }
    });
    Though, I agree with @Baidaly, it looks that a TriggerField is better for your requirement.
  9. #9
    Hi Daniil,

    thanks for your sample.
    But is possible to override server side OnTriggerClicked function?
    I tried, but not work, if i set a breakpoint does not intercept.

    Thanks.
  10. #10
    Quote Originally Posted by infonext View Post
    Hi Daniil,

    thanks for your sample.
    But is possible to override server side OnTriggerClicked function?
    I tried, but not work, if i set a breakpoint does not intercept.

    Thanks.
    I'm not sure what you mean, I don't see any method OnTriggerClicked within TriggerField class. Moreover, usually all method of any Control return some JS code, so you need to execute some JS code anyway, which is usually better to do on ClientSide.

    Can you clarify?
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: Jan 16, 2012, 12:14 AM
  2. combobox fire server side code on click
    By norphos in forum 1.x Help
    Replies: 0
    Last Post: Sep 26, 2011, 6:46 AM
  3. Fire click event on a combobox
    By mojo in forum 1.x Help
    Replies: 1
    Last Post: Dec 13, 2010, 3:25 PM
  4. Fire cell click on row double-click
    By RPIRES in forum 1.x Help
    Replies: 1
    Last Post: Jul 01, 2010, 8:20 PM
  5. [CLOSED] Combobox click on arrow event?
    By Sharon in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 31, 2009, 12:02 PM

Posting Permissions