Skip to content

ApiO/jquery.dataTables.multiselect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery.dataTables.multiselect

NuGet license

Extension of jquery.dataTables plugin for multi selection.

If you are using jquery.dataTables 1.10.8 or above, use Select and AreaSelect extensions.

Documentation & demo

For code sample check out the index.html file or go to live demo.

Minimal browser compatibility

Web browser Version
Chrome Ok
Firefox v3.5
IE v9
Opera v10
Safari v4

Dependencies

jQuery v1.11.3 at least. Works perfectly on higher versions.
jquery.dataTables v1.10.7 or higher version without the Select extension.

Features

  • Drag & drop onto table row to select a range of rows.
  • Selected rows are styled.
  • Hold Ctrl to add item to an existing selection.
  • dataTables trigger "selectionChanged.dt" event and send data rows array to callback.
  • You can enable/disable selection by code with the function: selectable(bool)
  • Allow multiple instance of selectable dataTables on the same page.

Usages

	<!-- reference both css and js files -->
    <link href="css/jquery.dataTables.multiselect.css" rel="stylesheet">
    <script src="js/jquery.dataTables.multiselect.js"></script>
    
	<!-- Add a table to your page -->
	<table id="my_table"></table>
  $("#my_table")
      // initializes dataTable as usual
      .dataTable({
          data: ...,
          columns: [ ... ],
          initComplete: function () {
              // enables multi selection extension
              $("#my_table").enableExtendedSelection();
          }
      })
      // binds callback to selection change event
      .on("selectionChanged.dt", function (event, params) {
          console.info("Selection", params.data);
      });
	// to get the current selection by code
	var arr = $("#my_table").data().selection.items;
	// Disable/enable multiselection
	$("#my_table").selectable(false/true);

Callback events

Event Description
selectionChanged.dt Triggered when the selection changed.

License

Released under the MIT license.

About

Extension of jquery.dataTables plugin for multi selection

Resources

Stars

Watchers

Forks

Packages

No packages published