Link to home
Create AccountLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

I need a workaround forcing ComboxBox closeup.

I have this function and when there is no Alert, the ComboBox does not close on SelectedIndexChanged. With the Alert, on OK click, the ComboBox closes down.


        function onCustomerChanged(cmbCustomer) {

            alert("onCustomerChanged");

            var cmbProduct = grdInventory.GetEditor("Prdcod");

            cmbCustomer.SetEnabled(false);

            cmbProduct.PerformCallback(cmbCustomer.GetValue().toString(), function () {

                cmbCustomer.SetReadOnly(false);

                cmbProduct.SetSelectedIndex(0);

            });

        }


This is DevExpress. Is there a way to "cheat" that ComboBox to close? Something I can use in place of the Alert where nothing shows, but the ComboBox closes?


Without this call         


alert("onCustomerChanged");


I need to click two times on the selected item in order to close it.


Thanks

ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
@Ashraf At least remove the "javascriptCopy code" from your ChatGPT generated answer

you are right 

So remove it - you can edit your answer
Avatar of curiouswebster

ASKER

It turns out I was using the wrong for this variable:


            var cmbProduct = grdInventory.GetEditor("Prdcod");


So, it was hangng there.


Thanks