visiosoft/datatable_helper-extension

There is no license information available for the latest version (1.0) of this package.

Installs: 122

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:CSS

Type:streams-addon

1.0 2023-09-13 06:39 UTC

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)