Closed wgwz closed 1 year ago
Here is the workaround I am using:
const datatable = new DataTable(datatableElement, {
columns: header,
data: userData,
checkboxColumn: checkBoxColumn,
layout: layout,
serialNoColumn: serialNoColumn,
});
$("div.dt-dropdown__list-item:nth-child(3)").hide();
$("div.dt-dropdown__list-item:nth-child(4)").hide();
End result of that is being able to hide the "Reset Sort" and the "Remove Column" dropdown options.
These lines seem to force users to have to use the default fields for the
headerDropdown
, IMO it's less surprising to always override theheaderDropdown
with whatever is passed in theDatatable
object. It's also unclear if there is an idiomatic way around this issue using this library:https://github.com/frappe/datatable/blob/31264d1f4da9445c147fdc1060914aa44fa440fa/src/datatable.js#L52-L56
Or perhaps my JS knowledge is insufficient and there is an obvious way to do this. In any case, feedback appreciated.