Posted 13 May 2024, 6:28 am EST
Is there any way to apply autocomplete to a list cell?
simple vertical text list
https://developer.mescius.com/spreadjs/demos/features/cells/drop-downs/list/angular
Forums Home / Spread / SpreadJS
Posted by: khauam.cardoso on 13 May 2024, 6:28 am EST
Posted 13 May 2024, 6:28 am EST
Is there any way to apply autocomplete to a list cell?
simple vertical text list
https://developer.mescius.com/spreadjs/demos/features/cells/drop-downs/list/angular
Posted 13 May 2024, 11:48 pm EST
Hi,
The SpreadJS DropDown List controls lack the implementation of AutoComplete. You need to create Custom Cell Type for this.
You can create Custom Cell Type for AutoComplete feature in the SpreadJS. Refer to the following blog on AutoComplete Cell type in SpreadJS: https://developer.mescius.com/blogs/autocomplete-celltype-in-spreadjs
SpreadJS Custom Cell Type Demo: https://developer.mescius.com/spreadjs/demos/features/cells/cell-types/custom/purejs
I have also attached a sample that implement AutoComplete Cell Type.
Regards,
Ankit
Posted 15 May 2024, 11:21 pm EST
Thanks for the answer, I’m currently using workflowList, is there any way to disable typing in the cell and only leave the possible choices?
angular 16 with spread 17
Posted 16 May 2024, 10:20 pm EST
Hey,
Thanks for the information if you are using the workflow list you may use the following code to disable editing and then the user will need to enter values using the workflow drop only.
sheet.bind(GC.Spread.Sheets.Events.EditStarting,(e,args)=>{
let {sheet,row,col} =args;
let style = sheet.getActualStyle(row,col);
if(style.dropDowns instanceof Array && style.dropDowns.length>0 ){
args.cancel =true;
}
});
EditStarting Event: https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.Events#editstarting
Regards,
Ankit