Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1845
"Change" event?
posted

I'm looking for a "change" event for the igCombo that would fire once when the value is changed.  The selectionChanged event seems like it should fill this role, but it fires twice when you select from the drop-down, once before the text is filled into the box, and once after.  Is this a bug or by design?  If by design, any suggestions on how to only capture the 2nd time it fires?

Parents
No Data
Reply
  • 2048
    posted

    Hi,

    I don't know if I can help you, but I encountered this "bug" too. Unfortunately I did not write here or asked to anyone and I don't know if it is something like "our error" or an "ig bug".

    What I did is to insert a boolean varaible in javascript code, to let first change event be captured, and stopping the second one:

        done = false;
      
        $("#combo_id").bind("igcomboselectionchanged", comboValueChanged);

        function comboValueChanged(evt, ui) {
            if( $("#combo_id").igCombo("selectedIndex") != -1 && !done)
            {
                //DO SOMETHING
            }
        }

    This worked fine for me, because when the same event has caught the second time it arrives to the function, but it stops because of the false condition (and the if statement has no else statement).

    But, of course, this is just a trick. Probably it is not what you would like to have...

Children