Results 1 to 4 of 4

Thread: Combobox Select event

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    5

    Default Answered: Combobox Select event

    Hi !

    I've a problem with combobox select event [Ext4] which doesn't fire when you select the same item a second time. I need to reload a data store even the same value is selected.
    This functionality was working with Ext 3

    How can i resolve this problem

    Thanks

  2. You can get all click events from the box's underlying list:

    Code:
     var box = Ext.create('Ext.form.field.ComboBox', {
               ...
               listConfig : {
                    listeners : {
                        'itemclick' : {
                            fn : function(dataViewModel, rec) {
                                console.log("list click event");
                            },
                        },
                    },
                },
                listeners : {
                    'select' : {
                        fn : function(box) {
                            console.log("box select event");
                        },
                    },
               },
    });
    Hope that helps.

  3. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106

    Default

    I haven't tried this, but you might be able to use the 'beforeselect' event. In this event, you could query the combo for any currently selected item. If there is already a selected item, then compare it with what get's passed to the beforeselect event (record or index parameters).

    If the records/indices match, then call your reload/refresh code.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    11
    Answers
    1

    Default

    You can get all click events from the box's underlying list:

    Code:
     var box = Ext.create('Ext.form.field.ComboBox', {
               ...
               listConfig : {
                    listeners : {
                        'itemclick' : {
                            fn : function(dataViewModel, rec) {
                                console.log("list click event");
                            },
                        },
                    },
                },
                listeners : {
                    'select' : {
                        fn : function(box) {
                            console.log("box select event");
                        },
                    },
               },
    });
    Hope that helps.

  5. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    5

    Default

    Great for listconfig solution it works fine !
    For information, the beforeselect event fire a second time only if the combox lost the focus when you click outside for instance

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •