Grid AutoComplete does not allow to clear

I have a situaiotn where Autocomplete in grid column. once you enter and save,  data can not be cleared

<e-column field="TaskStartDate" headerText="Need-by-Date" type='date' [edit]="dpParam" format="M/d/y" width="150" [isFrozen]="false"></e-column>

Below is the function 

l
export function fn_dpResource(that:any,resInfo:[],key:string,Id:string){
let dpResource:IEditCell={
create: function () {
that.elem = document.createElement('input');
return that.elem;
},
read: function () {
return that.dObj.text;
},
destroy: function () {
// if(that.dObj)
// that.dObj.destroy();
},
write: function (args:any) {
that.dObj = new AutoComplete({
autofill:true,
highlight: true,
suggestionCount:999,
dataSource: resInfo,
ignoreCase:true,
value: args.rowData !== undefined ? args.rowData[key] : "-", //"ResourceName"
filterType:"Contains",
fields:{ text:key},
placeholder:'Search User',
actionComplete:function(args){
console.log('actioncomplete');
console.log(args);
},
change:function(args){
let items:any = [];
if(that.gridBudgetPlan.getSelectedRowIndexes().length>0){
let rwoIndex=that.gridBudgetPlan.getSelectedRowIndexes()[0];
if(args.itemData!=null && args.itemData[Id]!=undefined){
that.gridBudgetPlan.updateCell(rwoIndex,Id,args.itemData[Id]); //'ResourceId'
}else{
that.gridBudgetPlan.updateCell(rwoIndex,Id,null);
//(that.dObj as AutoComplete).value=null;
}
}
return items;
}
});
that.dObj.appendTo(that.elem);
}
};
return dpResource;
}

Will it be possible for support to create a small sample so i can validate my code with it. 

Please note that I am using following packages

"@syncfusion/ej2-angular-dropdowns": "^21.2.5",
"@syncfusion/ej2-angular-grids": "21.2.5",

1 Reply

RR Rajapandi Ravi Syncfusion Team November 20, 2023 10:18 AM UTC

Hi Pdev,


Greetings from Syncfusion support


You can render the Autocomplete component while editing by using cell edit template feature of Grid. We have already discussed about your requirement in our documentation which can be accessed from the below link,


Documentation: https://ej2.syncfusion.com/angular/documentation/grid/editing/edit-types#render-autocomplete-component-while-editing


In your query you have mentioned that “once you enter and save,  data cannot be cleared”, we need some more information for our clarification. Please share the below details that will be helpful for us to provide better solution.


1)             Share your complete Grid rendering code (html and ts file), we would like to check your entire Grid settings.


2)             Please confirm you are Syncfusion package version.


3)             Share the issue scenario in video demonstration format.


4)             Share your exact requirement scenario with detailed description.


5)             Share your issue scenario in video demonstration format.


Regards,

Rajapandi R


Loader.
Up arrow icon