I have a scenario where the collection view will be updated depending on what data is loaded and if the WjAutoComplete is already initialized it will default to the first index of the CollectionView.
This is not the functionality I want, I have looked at other “solutions” and all I see is unneeded workarounds that required referencing the WjAutoComplete in the .ts file. this would be fine if I did not need to repeat this several times which will just become a pain.
Is there any way to stop it indexing to the first element when the collection view gets refreshed, I do not want to reference it in the typescript and manually do it, should I just use another solution?
Could you please share the code snippet that shows how the data is updated? If you are directly assigning a CollectionView as the itemsSource, then you may simply set the text property to null when the itemsSourceChanged event is fired:
This, does not work and makes the AutoComplete default to the first index, I want to default it to whatever value the endpoint is telling it to be. It seems like this cannot be done. This also fires off an event when subscribing to the value changes setting the idControl value to null.
Simply setting the value of the FormControl object will not update the value in AutoComplete. You will need to explicitly find the whole item with the defaultId and set the value of the AutoCompelete control. This will also update the value of formControl automatically. Please refer to the code snippet below and the sample attached: