visiosoft / datatable_helper-extension
Installs: 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:CSS
Type:streams-addon
This package is auto-updated.
Last update: 2024-10-31 00:33:11 UTC
README
This Extension Provides Manage Your Datatables Easyly
You can include asset twig bundle
{% include 'visiosoft.extension.datatable_helper::assets' %}
You can directly use dtHelper
Setters
dtHelper.setScrollCollapse(true);
dtHelper.setFilter(false);
dtHelper.setTableElement(tableName);
dtHelper.setDom(<"top"i>rt<"bottom"flp><"clear">);
dtHelper.setScrollY("30vh");
Getters
getData(element, data)
getButtons(buttons)
Usage Example
let exampleTable = {
element: $('#exampleTable'),
filterElement: $('#exampleTable thead th'),
data: [
{
data: ((row) => {
return row.data?.data || "-"
}),
},
{
data: ((row) => {
return row.data?.data || "-"
}),
}
]
}
dtHelper.setScrollCollapse(true);
dtHelper.setFilter(false);
dtHelper.setTableElement(exampleTable);
activeTransactionsTable = dtHelper.initDataTable();
// Live Reload
setInterval(function () {
exampleTable.ajax.reload()
}, 30000)