Closed DJoshi009 closed 1 year ago
Thanks for the report, will test asap
OK, tested and here's a sample to hopefully help you along
Tested:
https://user-images.githubusercontent.com/1793042/217838171-b8f3d380-d5ad-4cab-a0db-e5aae8caf56b.mp4
Thank but before I test your implementation, I encountered new issue while instantiating AutocompleteCombobox. I have to generate these dinamically at runtime but when it instantiate it throws null exceptions. I have tried initialized() after instantiate but errors are not resolving. Here is my code and errors.
teamList = JsonUtility.FromJson<TeamList>(webRequest.downloadHandler.text);
for (int i = 0; i < teamList.teams.Count; i++)
{
GameObject tableRow = Instantiate(teamRowPrefab);
tableRow.transform.SetParent(teamTableContainer);
tableRow.transform.Find("AutoCompleteComboBox_User").GetComponent<AutoCompleteComboBox>().Awake();
tableRow.transform.Find("AutoCompleteComboBox_Role").GetComponent<AutoCompleteComboBox>().Awake();
}
I was about to dig in but I see an issue on line 4, you are not setting a parent for the Prefab when instantiating it, All UI Objects need to be instantiated as a child of a canvas.
Change the following line:
GameObject tableRow = Instantiate(teamRowPrefab);
To something like:
Canvas myCanvas; // <- Get or assign the canvas in the scene.
GameObject tableRow = Instantiate(teamRowPrefab, myCanvas);
This will instantiate the control on a canvas.
Hope that helps.
Thanks that worked...!
Glad you go it working, closing issue.
Unity UI Extensions Bug Report
Describe the bug
I have tested SelectFirstItemOnStart while populating list in IEnumerator method and it does not work, I have tested same using example scene too. I guess the properties initialize before we fetch data from API
To Reproduce
Get data from API using Json Utility create a list and set into SetAvailableOptions to populate data in inspector. By doing this SelectItemIndexOnStart does not work even SelectFirstItemOnStart does not work.
My code
[System.Serializable] public class AllUsersClass { public int user_id; public string employeeName; }