Hi bryntum team.
As shown in pic1.
I want to assign the data returned from the back end to the items of tbar .But not as I expected .
this.teamList is empty. I know it's a matter of code execution order . but i have no workaround.
Do you have any suggestions for me?
Support Forum
- Attachments
-
- pic1
- pic1.png (51.71 KiB) Viewed 694 times
Hi,
Looks like a confusion between plain JavaScript and Angular bindings. this.teamList
in your code looks like a normal JavaScript variable. Assigning to it will not automatically reassign it to other places in the code where it is used. You should instead assign the loaded data directly to the items
property of the combo. Something like this:
// replace row 83
// this.teamList = res.result
// with:
taskBoard.widgetMap.selectTeam.items = res.result;
Assuming that your TaskBoard instance is accessible as taskBoard
and that res.result
is in a format accepted by combo.
Also since getTeamList()
is async (because of the backend call), the initial assignment on row 66 is probably redundant (teams are not loaded yet when you assign it there).
Best regards,
Johan Isaksson
Johan Isaksson