mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 01:04:01 +00:00
Centralize default DataTables init settings (references #424)
This commit is contained in:
@@ -625,3 +625,22 @@ $(document).on("click", ".show-as-dialog-link", function(e)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Default DataTables initialisation settings
|
||||
$.extend(true, $.fn.dataTable.defaults, {
|
||||
'paginate': false,
|
||||
'deferRender': true,
|
||||
'language': IsJsonString(__t('datatables_localization')) ? JSON.parse(__t('datatables_localization')) : { },
|
||||
'scrollY': false,
|
||||
'colReorder': true,
|
||||
'stateSave': true,
|
||||
'stateSaveParams': function (settings, data)
|
||||
{
|
||||
data.search.search = "";
|
||||
|
||||
data.columns.forEach(column =>
|
||||
{
|
||||
column.search.search = "";
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user