1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    India
    Posts
    87
    Vote Rating
    0
    Ronits is on a distinguished road

      0  

    Default Unanswered: Trigger on mouse over/hover in Combobox

    Unanswered: Trigger on mouse over/hover in Combobox


    Hi,
    I have set the hideTrigger property of combo box to true. Now, the trigger doesn't show up. How can I bring down the list on hover event, instead of the default click event.
    Thanks,
    Ronz

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,993
    Vote Rating
    212
    Answers
    476
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Code:
    hideTrigger: true,
    listeners: {
        afterrender: function () {
          var me = this;
            me.el.on('mouseover', function () {
              me.expand();
            }, me);
        }
    }

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    India
    Posts
    87
    Vote Rating
    0
    Ronits is on a distinguished road

      0  

    Default


    Thanks. It worked.
    I would like to have a mouse out event, when user does the mouse out event, on the combobox list i.e. moves the mouse out of the combobox value list, the combobox list should collapse. Any help
    Thanks,
    Ronz

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,993
    Vote Rating
    212
    Answers
    476
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    monitorMouseLeave should do the trick. the first param is how many milliseconds to wait before taking action.
    http://docs.sencha.com/ext-js/4-1/#!...itorMouseLeave


    Code:
    hideTrigger: true,
    listeners: {
        afterrender: function (combo) {
            combo.el.on('mouseover', function () {
              combo.expand();
            }, combo);
        }
        , expand: function (combo) {
            combo.mouseLeaveMonitor = combo.getPicker().el.monitorMouseLeave(500, combo.collapse, combo);
        }
        , destroy: function (combo) {
            combo.getPicker().el.un(combo.mouseLeaveMonitor);
        }
        , single: true
    }

Thread Participants: 1

Tags for this Thread