- Home
- Forum
- Angular - EJ 2
- ejs-dropdowntree setting value before dataSource is available does not work
ejs-dropdowntree setting value before dataSource is available does not work
As subject states, when I have a ejs-dropdowntree with a value assigned to it, like ["1"]. That is supposed to pre-select the first entry after data is bound. However when my data gets bound the first entry never gets selected.
Not sure if it matters but I set my value through a reactive form, as my ejs-dropdowntree is a formControl. So you can reproduce this simply by:
Assume that data has nodeIds: 1, 2, 3, 4, 5, etc.
My package is on the latest version (updated and tested on 4/17/26)
HTML:
<ejs-dropdowntree [fields]='fields' formControlName="myControl"></ejs-dropdowntree>
TS:
public fields;
ngOnInit() {
this.formGroup.get("myControl").setValue(["1"]);
this.getData().subscribe({
next: (data) => {
this.fields = { dataSource: data, value: 'nodeId', text: 'nodeText', child: 'nodeChild' }
}
});
}
Hi Dimitrije,
Greetings from Syncfusion Support.
Based on the information provided, we have validated and classified the reported scenarios as a bug on our end. The fix for this issue will be included in the upcoming weekly release scheduled for May 5,2026. You can track the status of the fix at the following link:
Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.
Regards,
Praveen Sellappan
I totally relate to the struggle of setting values before the datasource is ready! I faced a similar issue while using dropdowns in another project. A little delay with async data can really mess up your bindings. I ended up creating a fallback mechanism that waits for data availability, which made things smoother! Hope you find a good solution!
Hi Omar,
Thank you for sharing your experience and suggestion. We appreciate your input.
Regards,
Praveen Sellappan
Hi Dimitrije,
We regret to inform you that we were unable to include the fix for the reported issue in the weekly patch release as previously communicated.
However, we are pleased to inform you that the fix has been planned for inclusion in our upcoming weekly patch release, scheduled for May 19, 2026.
Thank you for your patience and understanding.
Regards,
Praveen Sellappan
That is great, thanks!
Hi Dimitrije,
We have included a fix for the issue "DropDownTree: Node fails to select when value property is set before dataSource assignment" in our latest release version 33.2.7. We recommend upgrading to the latest version to resolve this issue. We have included the sample for your reference,
Sample: https://stackblitz.com/edit/angular-y2vhc7ok-n3v5jdft?file=package.json,src%2Fapp.component.ts
Release Notes: https://ej2.syncfusion.com/angular/documentation/release-notes/33.2.7?type=all#dropdowntree
Root Cause:
When saved selections are
processed before all options are fully loaded. This can cause some valid
selections to be missed and not restored afterward.
Regards,
Jafar Ali S
- 8 Replies
- 4 Participants
- Marked answer
-
DP Dimitrije Prosevski
- Apr 16, 2026 04:59 PM UTC
- May 29, 2026 08:37 PM UTC