Datepicker on selected row only

Tags: #<Tag:0x00007f0b08ff9ca8>

Hi, is there a way to have a datepicker not for the entire column but on selected row only and having the rest of the rows in that column as text? Thank you.

Hi,

Yes, you can use cells[1] option to customize each cell renderer / editor and other properties.

Kind regards,
Wojciech

[1] https://handsontable.com/docs/7.2.2/Options.html#cells

Thank you, is there an example of how to use this cells function or how to add datepicker in this cell’s custom render? All that is working for me is column level if I specify it like this (but then again all rows in the column show a datepicker):
data: ‘column2’,
type: ‘date’,
datePickerConfig: {
// First day of the week (0: Sunday, 1: Monday, etc)
firstDay: 0,
showWeekNumber: true,
numberOfMonths: 3,
disableDayFn: function(date) {
// Disable Sunday and Saturday
return date.getDay() === 0 || date.getDay() === 6;
}
},

I think I found it here:

Seems to be working, but please let me know if it’s not the best way to have different cell types in the same column. Thanks.

and it shows errors “Property ‘type’ does not exist on type ‘{}’” that does not affect the functionality, but still a bit annoying. You can see it in the stackblitz as well.

Hi,

Yes, that is a correct implementation.The type error is from Typescript. The tool will take let cp = {}; and type check all further assignments. You can define type let cp = {} as { type: string, source: string[] }; or any other means you like. It’s not Handsontable releated

Kind Regards
Wojciech

Right. Thank you.