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?
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...
Thanks Flavio, but given this code, //DO SOMETHING will never be reached because "done" is always false. Even if you initialized done to true, and then set it to false where //DO SOMETHING is (I think that's what you intended?), then any further selections won't be processed because, after the first selection, done will always be false.
What I ended up doing was similar to your solution, but I stored the value of the combo in a variable, then checked to see if the value was the same.
var currentVal = null;