Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giterlizzi/perl-mojolicious-plugin-datatables
Mojolicious Plugin for DataTables
https://github.com/giterlizzi/perl-mojolicious-plugin-datatables
datatables hacktoberfest mojolicious perl plugin
Last synced: 17 days ago
JSON representation
Mojolicious Plugin for DataTables
- Host: GitHub
- URL: https://github.com/giterlizzi/perl-mojolicious-plugin-datatables
- Owner: giterlizzi
- License: artistic-2.0
- Created: 2020-03-26T21:53:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-20T00:03:02.000Z (almost 4 years ago)
- Last Synced: 2024-05-01T21:26:13.524Z (8 months ago)
- Topics: datatables, hacktoberfest, mojolicious, perl, plugin
- Language: Perl
- Homepage: https://metacpan.org/release/Mojolicious-Plugin-DataTables
- Size: 22.5 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[![Release](https://img.shields.io/github/release/giterlizzi/perl-Mojolicious-Plugin-DataTables.svg)](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables/releases) [![Actions Status](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables/workflows/linux/badge.svg)](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables/actions) [![Actions Status](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables/workflows/macos/badge.svg)](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables/actions) [![License](https://img.shields.io/github/license/giterlizzi/perl-Mojolicious-Plugin-DataTables.svg)](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables) [![Starts](https://img.shields.io/github/stars/giterlizzi/perl-Mojolicious-Plugin-DataTables.svg)](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables) [![Forks](https://img.shields.io/github/forks/giterlizzi/perl-Mojolicious-Plugin-DataTables.svg)](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables) [![Issues](https://img.shields.io/github/issues/giterlizzi/perl-Mojolicious-Plugin-DataTables.svg)](https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables/issues) [![Coverage Status](https://coveralls.io/repos/github/giterlizzi/perl-Mojolicious-Plugin-DataTables/badge.svg)](https://coveralls.io/github/giterlizzi/perl-Mojolicious-Plugin-DataTables)
# Mojolicious::Plugin::DataTables
## Usage
```.pl
# Mojolicious
$self->plugin('DataTables');# Mojolicious::Lite
plugin 'DataTables';helper sql => sub { state $pg = Mojo::Pg->new('postgresql://postgres@/test') };
get '/users_table' => sub {
my $c = shift;
my $sql = $c->sql;my $dt_ssp = $c->datatable->ssp(
table => 'users',
sql => $sql,
options => [
{
label => 'UID',
db => 'uid',
dt => 0,
},
{
label => 'e-Mail',
db => 'mail',
dt => 1,
},
{
label => 'Status',
db => 'status',
dt => 2,
},
]
));$c->render(json => $dt_ssp);
};```
```.html
@@ template.html.ep<%= datatables_js %>
<%= datatables_css %>
UID
Status
jQuery('#users_table').DataTable({
serverSide : true,
ajax : '/users_table',
});
```
## Installation
To install this module type the following:
perl Makefile.PL
make
make test
make install## Copyright
Copyright (C) 2020-2021 by Giuseppe Di Terlizzi