Hi Team,
I am using ejs grid version: "^21.2.3", and angular 16,
I tried to clear text value of dropdown list getting below error
this.DDlobject.value = null -- issue
code:
component
import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { DropDownListComponent } from "@syncfusion/ej2-angular-dropdowns";
@Component({
selector: 'ge-upload-lcadata',
templateUrl: './upload-lcadata.component.html',
styleUrls: ['./upload-lcadata.component.scss'],
encapsulation: ViewEncapsulation.None,
})
export class UploadLcadataComponent implements OnInit {
@ViewChild('ddlelement', { static: false })
public DDlobject: DropDownListComponent;
public value: string = '';
public ccDropdownList: any[] = [];
constructor() { }
ngOnInit(): void {
this.ccDropdownList = [
{
id: "1",
value: "Yes"
},
{
id: "2",
value: "No"
},
];
}
onCCChange(event: any) {
let value = event.value;
}
reSetValue(){
debugger;
this.DDlobject.value = null;
}
}
html
<div>
<ejs-dropdownlist #ddlelement id='ddlelement' [dataSource]='ccDropdownList'
[fields]="{ text: 'value', id: 'id' }"
[value]="value"
popupHeight='auto' popupWidth='auto'
[ignoreAccent]='true'
placeholder='Select a value'
filterBarPlaceholder='Filter of Credit Card'
(change)='onCCChange($event)'>
</ejs-dropdownlist>
<button type="button" class="btn btn-secondary btnfont mar-left-15" (click)="reSetValue()">Reset</button>
</div>
might be if i used angular 16 and ejs grid "^21.2.3", getting below issue
i observed
used angular 8 and ejs grid "^19.3.54",",
not issue of this.DDlobject.value = null;
please resolve issue and let me know asap.
Thanks & Regards
Chalamaiah N
Hi Narsimsetty Chalamaiah,
Greetings from Syncfusion support.
Before we proceed with providing a solution to your query, we would like to request some additional information to better understand the issue you are facing. Please provide us with the following details:
We appreciate your cooperation in providing us with the requested information, as it will help us provide a more effective solution to your query.
Regards,
Hemanth Kumar S
Hi Hemanthkumar ,
I am using Dropdown list out side grid, this is not grid realted issue,
am using "@syncfusion/ej2-angular-dropdowns": "^21.2.3", version with angular 16,
getting this.DDlobject.value = null; issue only
i am giving all code to you.
please find below code
Component Code:
import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { DropDownListComponent } from "@syncfusion/ej2-angular-dropdowns";
@Component({
selector: 'ge-upload-lcadata',
templateUrl: './upload-lcadata.component.html',
styleUrls: ['./upload-lcadata.component.scss'],
encapsulation: ViewEncapsulation.None,
})
export class UploadLcadataComponent implements OnInit {
@ViewChild('ddlelement', { static: false })
public DDlobject: DropDownListComponent;
public value: string = '';
public ccDropdownList: any[] = [];
constructor() { }
ngOnInit(): void {
this.ccDropdownList = [
{
id: "1",
value: "Yes"
},
{
id: "2",
value: "No"
},
];
}
onCCChange(event: any) {
let value = event.value;
}
reSetValue() {
this.DDlobject.value = null;
}
}
Html
<div>
<ejs-dropdownlist #ddlelement id='ddlelement' [dataSource]='ccDropdownList'
[fields]="{ text: 'value', id: 'id' }"
[value]="value"
popupHeight='auto' popupWidth='auto'
[ignoreAccent]='true'
placeholder='Select a value'
filterBarPlaceholder='Filter of Credit Card'
(change)='onCCChange($event)'>
</ejs-dropdownlist>
<button type="button" class="btn btn-secondary btnfont mar-left-15" (click)="reSetValue()">Reset</button>
</div>
If not understand please setupcall on 26-05-2023 by 4pm IST,
Thanks & Regards
Chalamaiah N
Hi Team,
I followed below link
https://stackblitz.com/edit/angular-dgvhuv-sjyvso?file=src%2Fapp.component.ts
I am using ejs grid version: "^21.2.3", and angular 16, getting below issue
but As i observed used angular 8 and ejs grid "^19.3.54", not getting issue
please find previous request link : https://support.syncfusion.com/support/tickets/441627
please find below screen shot
if not understand please set up call on 26-05-2023 by 4pm.
Thanks & Regards
Chalamaiah N
Hi Team,
I replayed on 25th may but so far i didn't get resolve issue, please update asap.
Thanks & Regards
Chalamaiah N
Hi Narsimsetty,
We have prepared sample as per shared information. You can resolve the reported issue by change the following line on your sample. Please find the code snippet and sample attached for your reference.
@ViewChild('ddlelement', { static: false }) public DDlobject!: DropDownListComponent; reSetValue() { (this.DDlobject as any).value = null; } |
Regards,
Priyanka K
Thanks for update , it is working as expected.
Thanks & regards
Chalamaiah N