We are trying to use 'datetimefield' as a widget column. I see the sorting arrow in the column when i set
sortable : true
to the column but I do not get the sorting work. Could you help with it?
In the example https://www.bryntum.com/examples/grid/columntypes/, made the following changes to the widget
{
text : 'Widget',
field : 'date',
width : 100,
sortable: true,
type : 'widget',
widgets : [{
type : 'datetimefield',
tooltip : 'Add',
icon : 'b-fa b-fa-plus',
cls : 'b-blue b-raised',
onAction : ({ source : btn }) => {
btn.cellInfo.record.age++;
}
}]
},
. I fill in the datefield as follows
When i sort the column now i do not get it sorted.
Hi janan,
By default sort
feature uses a value inside a cell for sorting. WidgetColumn
contains a widget inside, some HTML code. It cannot be sorted by value inside one of your inputs that you placed, by default. You need to provide your own sortable function with the logic you expected.
Please check https://bryntum.com/docs/scheduler/#Grid/column/WidgetColumn#config-sortable
sortable : function(rec1, rec2) {
return rec1.date < rec2.date ? -1 : 1;
}
All best,
Alex
All the best,
Alex