Skip to content

maxfurman/play-jquery-tabletools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

jQuery DataTables TableTools Play! Module

Background

jQuery

jQuery is a popular javascript toolkit.

jQuery DataTables

jQuery DataTables is a plugin for jQuery that makes it easy to provide ajax sorting, searching, and pagination on your tabular data.

jQuery DataTables TableTools

jQuery DataTables TableTools is an extra package can export the DataTable via Clipboard, CSV, Excel, PDF, and Print.

Play!

Play!" is an incredible web framework for Java.

Objective

This module makes it easy to add jQuery DataTables TableTools to your Play! project.

Quick start

To use TableTools on your (existing) jQuery datatable:

  • Download this module.
    $ git clone git://github.com/robfig/play-jquery-tabletools.git
    
  • Include this module by adding it to your application.conf (replace PATH_TO with the absolute or relative path to this module):
    module.jquery-tabletools=PATH_TO/play-jquery-tabletools
    
  • Include the javascript and css in your page:
    <script src="@{'/public/js/TableTools.min.js'}" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="@{'/public/css/TableTools.css'}">
    <link rel="stylesheet" type="text/css" href="@{'/public/css/TableTools_JUI.css'}">
  • Include the TableTools using ‘T’ in the ‘sDom’ setting, and set the path to the swf.
      $('#datatable').dataTable({
        ...
        "sDom": '<"H"lT>rt<"F"ip>',
        "oTableTools": {
          "sSwfPath": "@{'/public/swf/copy_cvs_xls_pdf.swf'}"
        },
      });

That’s it!

Note: you should have a route to staticDir:public in your conf/routes

About

Play! module for jQuery (DataTables) TableTools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published