{"id":16059046,"url":"https://github.com/gregmolnar/dtable","last_synced_at":"2025-06-12T18:32:37.975Z","repository":{"id":14243043,"uuid":"16950389","full_name":"gregmolnar/DTable","owner":"gregmolnar","description":"jQuery data table plugin","archived":false,"fork":false,"pushed_at":"2014-02-16T16:40:16.000Z","size":524,"stargazers_count":0,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T10:39:26.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregmolnar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-18T13:54:55.000Z","updated_at":"2021-05-29T23:49:26.000Z","dependencies_parsed_at":"2022-08-19T20:10:27.985Z","dependency_job_id":null,"html_url":"https://github.com/gregmolnar/DTable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregmolnar%2FDTable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregmolnar%2FDTable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregmolnar%2FDTable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregmolnar%2FDTable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregmolnar","download_url":"https://codeload.github.com/gregmolnar/DTable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregmolnar%2FDTable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258207064,"owners_count":22665070,"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":[],"created_at":"2024-10-09T03:41:36.280Z","updated_at":"2025-06-12T18:32:37.943Z","avatar_url":"https://github.com/gregmolnar.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"It's a data table for jQuery. I made it to study grunt and it's first part of my Symfony 2 admin boundle.  The plugin is highly customizable,\nIt's uses html template to generate the table (it's not necessary to be a table, can be anything see \"Custom template\" example) and the whole plugin module based,\nso you can add new features easily.\n\nThe built in template module uses [Nunjucks](http://jlongster.github.io/nunjucks/), you have to load it before DTable init.\n\n***Examples***\n\nSee [http://dtable.devdrive.org](http://dtable.devdrive.org)\n\n***Download***\n\nThis repo is used for development, you can [download](http://dtable.devdrive.org/publish/DTable.v0.5.0.tar.gz) the latest stable release.\n\n***How to use***\n\n``` javascript\n  $(\"#div\").dtable({});\n```\n\nEvry module has its own options, you can see it in the modules list.\n\n***Options***\n\n``` text\n  {\n    definition: {\n        name: \u003cmodule_name\u003e,            # default: \"json_url\"\n        options: \u003cmodule_options\u003e\n    },\n    template: {\n        name: \u003cmodule_name\u003e,            # default: \"nunjucks\"\n        options: \u003cmodule_options\u003e\n    },\n    logger: {\n        name: \u003cmodule_name\u003e,            # default: \"default\"\n        options: \u003cmodule_options\u003e\n    },\n    source: {\n        name: \u003cmodule_name\u003e,            # default: \"json_url\"\n        options: \u003cmodule_options\u003e\n    },\n    search: {\n        name: \u003cmodule_name\u003e,            # default: \"default\"\n        options: \u003cmodule_options\u003e\n    },\n    pagination: {\n        name: \u003cmodule_name\u003e,            # default: \"default\"\n        options: \u003cmodule_options\u003e\n    },\n    loading: {\n        name: \u003cmodule_name\u003e,            # default: \"default\"\n        options: \u003cmodule_options\u003e\n    },\n    order: {\n        name: \u003cmodule_name\u003e,            # default: \"default\"\n        options: \u003cmodule_options\u003e\n    },\n    formatter: {\n        name: \u003cmodule_name\u003e,            # default: \"false\"\n        options: \u003cmodule_options\u003e\n    }\n  }\n```\n-------------------------\n\nModules\n-------\n\n-------------------------\n***Definition modules***\n\nIts used to get the table definition, most of the configs goes from here.\n\n### \"json_url\"\n\n\u003e Load table definition from url. Request is sent with POST or GET and the response must be in json format.\n\n\n\u003e  ***options***:\n\n\u003e```\n    url: \u003cstring\u003e               # url to download the json data, default: \"\"\n    method: \u003c\"post\"|\"get\"\u003e      # method for request, default: \"get\"\n    data: {}                    # extra data to send, default: {}\n    timestamp: \u003ctrue|false\u003e     # if true, it will add timestamp to prevent caching the page\n```\n\n\u003e  ***response json format***\n\n\u003e ``` text\n{\n    \"title\": \u003cstring||false\u003e,                                       # table title\n    \"columns\": {\n        \u003ccolumn_id\u003e: {\n            \"title\":  \u003cfalse||string\u003e,                              # table title, if false no column title displayed,\n                                                                    # its work if all column title is false\n            \"filter\": \u003cfalse||true||{\"placeholder\": \u003cstring\u003e}\u003e,     # column filter, placeholder: input field placeholder\n            \"order\":  \u003cfalse||true\u003e,                                # column order enable/disable\n            \"html_tag_attr\":   \u003cfalse||{                            # html attr for column header\n              \u003cattr_name\u003e: \u003cattr_value\u003e\n            }\u003e,\n            // not required, used by formatter module\n            \"formatter\": \u003cformatter module specified options\u003e       # here you can set column option for formatter\n        }\n    }\n}\n```\n\n-------------------------\n***Template modules***\n\nIts used to renderer the template. There are 3 different template: table, rows, pagination.\n\n### \"nunjucks\"\n\n\u003e Requires [Nunjucks](http://jlongster.github.io/nunjucks/) to render the table. Its loading the template from the view_dir.\n\n\u003e***options***\n\u003e``` text\n    view_dir: \u003cstring\u003e                  # url pointing to the view dir, default: \"/view\"\n    table_template: \u003cstring\u003e            # table template filename, default: \"table.html\"\n    rows_template: \u003cstring\u003e             # rows template filename, default: \"rows.html\"\n    pagination_template: \u003cstring\u003e       # pagination template filename, default: \"pagination.html\"\n```\n\n-------------------------\n***Logger modules***\n\nIt's used to log errors/dev informations.\n\n### \"default\"\n\n\u003e***options***\n\u003e``` text\n    debug: \u003ctrue||false\u003e                # in debug mode debug information logged to the console\n```\n\n-------------------------\n***Source modules (data source)***\n\nIts used to get the table rows.\n\n### \"json_url\"\n\n\u003eIt will send the query string (built with search module) to the url, its require a json response.\n\n\u003e***options***\n\u003e``` text\n    url: \u003cstring\u003e                       # url to put query paramters, default: \"\"\n    method: \u003c\"post\"|\"get\"\u003e              # method to use, default: \"post\"\n```\n\n\u003e***query parameters***\n\u003e```\n    search: \u003cstring\u003e,\n    filter: \"\" || {\n        \u003ccolumn_id\u003e: \u003cfilter_text\u003e,\n        ...\n    },\n    per_page: \u003cint\u003e,\n    offset: \u003cint\u003e,\n    order: \"\" || {                      # currently only one order by column supported, but its possible to have more than one\n        \u003ccolumn_id\u003e: \"asc\"||\"desc\",\n        ...\n    }\n```\n\n\u003e***response json format***\n\u003e```\n    [\n        {\n            \u003ccol_id\u003e : \u003cvalue\u003e,\n            ....\n        },\n        ....\n    ]\n```\n\n-------------------------\n***Search modules***\n\nIts used to create query string (see source modules, query parameters), and initiate table refresh. Its handle the search and filter fields.\n\n### \"default\"\n\n\u003e ``` text\n    placeholder:                            # serch input field placeholder, default: \"search...\",\n    waiting: \u003cint\u003e                          # time in ms to wait after last modification in search\n                                            # paramters before submitting, default: 600\n```\n\n-------------------------\n***Pagination modules***\n\nIts used to handle pagination related tasks.\n\n### \"default\"\n\n\u003e**options**\n\u003e``` text\n    show_first_and_last: \u003cboolean\u003e          # in pager, first and last page shown? default: true\n    pages: \u003cint\u003e                            # how many page in the pager, odd number, default: 5\n    rows_per_page: \u003cint\u003e                    # results per page, default: 20\n    rows_per_page_select: [\u003cint\u003e, ...]      # rows per page select, default: [20, 50, 100]\n```\n\n-------------------------\n***Loading modules***\n\nShow loading message when the table refresh.\n\n### \"default\"\n\n\u003e There is no options. It's uses html tag with data-dtable=\"loading\" attr to show in the table header. If you want to make other\n\u003e loading indicator, pleas create one and make a pull request.\n\n-------------------------\n***Formatter modules***\n\nThis modules used to format cells, you can add formatter options to column definition, available options is depend on formatter.\n\n### \"simple\"\n\n\u003e escape html, no options\n\n-------------------------\nDev requirements\n================\n\n- nodejs\n- php5.4+ (for built in server)\n- grunt\n- npm\n- bower\n\nafter clone, run update.sh to update npm and bower modules.\n\n***usable grunt commands***\n\n- `grunt build`: build the plugin\n- `grunt server`: start server with live reloading on http://127.0.0.1:8080\n\nPlans\n-------\n\n- advanced formatter (string, partial, image)\n- a new loader module\n- better error handling\n- editable rows\n-- column types (int, string. select, multiselect, boolean)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregmolnar%2Fdtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregmolnar%2Fdtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregmolnar%2Fdtable/lists"}