Wj-auto-complete event does not fire on changed value

Posted by: seaninglis on 19 May 2022, 6:02 pm EST

    • Post Options:
    • Link

    Posted 19 May 2022, 6:02 pm EST

    Refer to the codemine below:

    https://jscodemine.grapecity.com/sample/NG77GGREi0e8UvJMfi69Kw/

    In the first autocomplete box, the (ngModelChanged) event only fires if the value in the control is one of the predefined list of values, and the [(ngModel)] binding also seems to no longer get updated.

    How can I fix this behaviour?

  • Posted 24 May 2022, 5:16 am EST

    Hello,

    We apologize for the delay, we are investigating the provided sample to find the root cause of the issue. We will provide you with an update at the earliest.

    Regards

  • Posted 24 May 2022, 6:04 pm EST

    Hello,

    In AutoComplete, by default ngModel is bind to selectedValue property. However, you can bind it to the text property using wjModelProperty. Then any change in AutoComplete text property will reflect on selectedtitle. Also, it will make the ngModelChange get fir when the text property will get changed. Please refer to the sample link below demonstrating the same:

    https://jscodemine.grapecity.com/share/EbGws_ynqU_AGbcNs6GW_A/

    Regards

    Sonu Kumar Pandey

  • Posted 29 June 2022, 6:59 pm EST

    Hi,

    Sorry, for some reason I missed your response altogether.

    Thanks for the solution - I ended up using a clumsier workaround but I’ll revisit the code with this in mind.

    Sean

    FTR: the workaround I used was to bind instead to [(text)] and do some additional processing in the (textChanged) event, which seems to work for my current requirement.

    I’d be interested to know if I just got lucky and this method happens to work for me at the moment, or whether I can continue to rely on it.

  • Posted 30 June 2022, 2:01 pm EST

    Yes, you may. The WjModelProperty used to assign the Control property to work as NgModel.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels