Logotype
JM Admin / Components / Data table / Bulk actions
User

Data table bulk actions Add-on

Extended functionality to component: Data table

Features
  • Generate a user interface for selecting records.
  • Enables you to perform actions to multiple records at once.
  • Send POST requests with data from the data-id attribute of the selected records.
  • Works with all variants of the Data table component.
Configuration
  • Include the compiled css file in the Html: <link href="/css/components/data-table.bulk-actions.min.css" rel="stylesheet" />
  • Include the compiled javascript file in the Html: <script src="/javascript/data-table.bulk-actions.min.js"></script>
Implementation Javascript
Basic

Create a DataTableBulkActions object with minimal configuration and a single link:

const myDataTableBulkActions = new DataTableBulkActions({ input: '#myDataTable', links: [ { url: '/download', text: 'Download' } ] });

Advanced

Create a DataTableBulkActions object with detailed configuration, other language (Swedish) and multiple links:

const myDataTableBulkActions = new DataTableBulkActions({ input: '#myDataTable', hidden: true, text: { singleSelected: 'vald', multipleSelected: 'valda', noneSelected: 'ingen vald', select: 'Välj', show: 'Visa', hide: 'Dölj' }, links: [ { url: '/download', text: 'Ladda ned', class: 'icon-download' }, { url: '/star', text: 'Lägg till stjärna', class: 'icon-star' }, { url: '/delete', text: 'Ta bort', class: 'icon-delete' } ] });

Examples

View source for Html code.


Always visible
Header
Cell A1
A2
A3
A4
Cell B1
B2
B3
B4
Cell C1
C2
C3
C4
Visible by default
Header
Cell A1
A2
A3
A4
Cell B1
B2
B3
B4
Cell C1
C2
C3
C4
Hidden by default
Header
Cell A1
A2
A3
A4
Cell B1
B2
B3
B4
Cell C1
C2
C3
C4
Collapsed data table, icons on links
Header
Cell A1
A2
A3
A4
Cell B1
B2
B3
B4
Cell C1
C2
C3
C4
Collapsed data table without header
Cell A1
A2
A3
A4
Cell B1
B2
B3
B4
Cell C1
C2
C3
C4
Different language (Swedish)
Rubrik
Cell A1
A2
A3
A4
Cell B1
B2
B3
B4
Cell C1
C2
C3
C4