{"id":14955821,"url":"https://github.com/mkhairi/jquery-datatables","last_synced_at":"2025-04-05T10:09:20.408Z","repository":{"id":56879309,"uuid":"66634382","full_name":"mkhairi/jquery-datatables","owner":"mkhairi","description":"Jquery datatables ruby gems for assets pipeline","archived":false,"fork":false,"pushed_at":"2024-08-12T10:51:59.000Z","size":4541,"stargazers_count":75,"open_issues_count":5,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T14:17:16.493Z","etag":null,"topics":["datatables","gem","jquery","jquery-datatables","jquery-datatables-rails","rails","ruby","rubygem","rubygems","rubyonrails"],"latest_commit_sha":null,"homepage":"https://datatables.net/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkhairi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-26T09:16:13.000Z","updated_at":"2024-08-12T10:52:03.000Z","dependencies_parsed_at":"2024-06-18T20:08:17.520Z","dependency_job_id":"90106cf8-1f33-4fee-9615-cb476860f67b","html_url":"https://github.com/mkhairi/jquery-datatables","commit_stats":{"total_commits":103,"total_committers":7,"mean_commits":"14.714285714285714","dds":"0.10679611650485432","last_synced_commit":"c44893a4919a0e6d838db63a17f8654b3c2f7357"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhairi%2Fjquery-datatables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhairi%2Fjquery-datatables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhairi%2Fjquery-datatables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkhairi%2Fjquery-datatables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkhairi","download_url":"https://codeload.github.com/mkhairi/jquery-datatables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318745,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datatables","gem","jquery","jquery-datatables","jquery-datatables-rails","rails","ruby","rubygem","rubygems","rubyonrails"],"created_at":"2024-09-24T13:11:51.492Z","updated_at":"2025-04-05T10:09:20.380Z","avatar_url":"https://github.com/mkhairi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jquery-datatables [![Gem Version](https://badge.fury.io/rb/jquery-datatables.svg)](http://badge.fury.io/rb/jquery-datatables)\nJquery datatables assets pipeline :: sprockets\n\nInclude [jQuery DataTables](http://www.datatables.net/) in your asset pipeline with ease using [jquery-datatables](https://rubygems.org/gems/jquery-datatables) gem.\n\n## Gem Installation\n\n### Requirements\n\n**Rails 6.0+**\n\nSince Webpacker the default JavaScript compiler for Rails 6. you can install via yarn.\n\nsee this [official](https://datatables.net/download/index) pages for details.\n\nHowever, if your app still using javascript with sprockets, this gem is still good to go.\nHow to use [sprocket assets pipeline instead of webpacker](https://stackoverflow.com/questions/59855323/rails-6-how-to-use-the-old-sprocket-assets-pipeline-instead-of-webpacker)\n\n\n**Rails 5.1+**\n\nThe Rails JavaScript helpers has been rewritten in a new gem called rails-ujs and they use vanilla JavaScript, so jQuery is not a dependency of Rails anymore. \n\nSince Jquery datatables relies on jQuery, you can install it with ```bin/yarn add jquery``` or via ```gem 'jquery-rails'```  and add ```//= require jquery``` to ```application.js```. \n\n**NOTE:** Ensure that the `sass-rails` gem is presented in your Gemfile.\n\n\nAdd this line to your application's `Gemfile`:\n\n```\ngem 'jquery-datatables'\n```\n\nAnd then execute:\n\n    $ bundle install\n\n## Install generator\n\n### command\n``` \nrails g jquery:datatables:install \n\n```\n\nor if you using css framework\n\n``` \nrails g jquery:datatables:install bootstrap4\n\n```\n\nthis generator will: \n  -  1. append ```//= require datatables ``` add `app/assets/javascripts/application.js`\n  -  2. append ```*= require datatables ``` add `app/assets/stylesheets/application.css`\n  -  3. create datatable.js  in ```app/assets/javascripts/``` with default init script.\n  -  4. create datatable.scss in  ```app/assets/stylesheets/```\n  -  5. create scaffold index template in ```lib/template```\n\n\navailable [styling](https://datatables.net/examples/styling/)\n - bootstrap \n - bootstrap4\n - foundation\n - jqueryui\n - sematicui\n - material (Tech. preview)\n - uikit (Tech. preview)\n\n\n## Manual install\n\n### JavaScripts\n\nInclude the JavaScript in your `app/assets/javascripts/application.js`:\n```\n//= require jquery\n//= require datatables\n\n```\ncreate new file `app/assets/javascripts/datatables.js`\n```\n//Core component\n//= require datatables/jquery.dataTables\n//Bootstrap4 theme\n//= require datatables/dataTables.bootstrap4\n\n//Optional Datatables extensions\n//= require datatables/extensions/Responsive/dataTables.responsive\n//= require datatables/extensions/Responsive/responsive.bootstrap4\n//= require datatables/extensions/Buttons/dataTables.buttons\n//= require datatables/extensions/Buttons/buttons.html5\n//= require datatables/extensions/Buttons/buttons.print\n//= require datatables/extensions/Buttons/buttons.bootstrap4\n\n```\n*** you may refer other extensions in this directory: [click me](https://github.com/mkhairi/jquery-datatables/tree/master/app/assets/javascripts/datatables/extensions)\n\n### Stylesheets\nInclude the stylesheet in your `app/assets/stylesheets/application.css`:\n```\n*= require datatables\n```\n\nor if you using scss\n\nInclude the stylesheet in your `app/assets/stylesheets/application.scss`:\n```scss\n@import 'datatables';\n```\n\nCreate new file `app/assets/stylesheets/datatables.scss`\n\u003cbr\u003e\n** default theme\n```scss\n@import 'datatables/jquery.dataTables';\n@import 'datatables/extensions/Responsive/responsive.dataTables';\n@import 'datatables/extensions/Buttons/buttons.dataTables';\n```\n** if using boostrap4 theme\n```scss\n@import 'datatables/dataTables.bootstrap4';\n@import 'datatables/extensions/Responsive/responsive.bootstrap4';\n@import 'datatables/extensions/Buttons/buttons.bootstrap4';\n\n```\n*** you may refer other extensions in this directory: [click me](https://github.com/mkhairi/jquery-datatables/tree/master/app/assets/stylesheets/datatables/extensions)\n\n\n### Basic Initialization\n\nWhere needed in your JavaScripts, initialize your DataTables:\n\n```\n$(document).ready(function() {\n  $(\"#dttb\").dataTable();\n});\n```\n\nAnd you will of course, need to have a html table (with a theader and tbody) with the id set to dttb. Here is an example:\n\n```html\n    \u003ctable id=\"dttb\" class=\"table table-hover\"\u003e\n      \u003cthead\u003e\n        \u003ctr\u003e\n          \u003cth\u003e Panel No\u003c/th\u003e          \n        \u003c/tr\u003e\n      \u003c/thead\u003e\n      \u003ctbody\u003e\n        \u003c% @panels.each do |panel| %\u003e\n          \u003ctr\u003e\n            \u003ctd\u003e\u003c%= link_to panel.no, panel %\u003e\u003c/td\u003e\n          \u003c/tr\u003e\n        \u003c% end %\u003e\n      \u003c/tbody\u003e\n    \u003c/table\u003e\n```\n\n### Server Side processing\n\nRecommended use this gem\n\n```ruby\n gem 'ajax-datatables-rails'\n```\nsee [docs](https://github.com/jbox-web/ajax-datatables-rails) for details instruction\n\n\n## Contributing\n\n1. [Fork it]( https://github.com/mkhairi/jquery-datatables/fork)\n2. Commit your changes (`git commit -am 'My Changes'`)\n3. Push your changes (`git push origin`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhairi%2Fjquery-datatables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkhairi%2Fjquery-datatables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkhairi%2Fjquery-datatables/lists"}