{"id":18555575,"url":"https://github.com/n2ref/coreui-table","last_synced_at":"2025-04-09T23:32:23.878Z","repository":{"id":62495319,"uuid":"78341449","full_name":"n2ref/coreui-table","owner":"n2ref","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-22T16:43:07.000Z","size":25001,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T12:53:25.242Z","etag":null,"topics":["coreui","framework","js","php","table"],"latest_commit_sha":null,"homepage":"https://n2ref.github.io/coreui-table","language":"JavaScript","has_issues":true,"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/n2ref.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-08T12:30:11.000Z","updated_at":"2025-02-22T16:43:11.000Z","dependencies_parsed_at":"2022-11-02T11:31:19.043Z","dependency_job_id":"9bbd8c01-9038-43b6-bee2-be32f14c51fd","html_url":"https://github.com/n2ref/coreui-table","commit_stats":{"total_commits":95,"total_committers":3,"mean_commits":"31.666666666666668","dds":"0.18947368421052635","last_synced_commit":"a01e8f07f057eb80d8192daa953f04fa7496de0e"},"previous_names":["n2ref/coreui-table","shabuninil/coreui-table"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fcoreui-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fcoreui-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fcoreui-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fcoreui-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n2ref","download_url":"https://codeload.github.com/n2ref/coreui-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248129927,"owners_count":21052664,"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":["coreui","framework","js","php","table"],"created_at":"2024-11-06T21:27:09.627Z","updated_at":"2025-04-09T23:32:20.920Z","avatar_url":"https://github.com/n2ref.png","language":"JavaScript","readme":"# CoreUI table\n\n**[DEMO](https://n2ref.github.io/coreui-table)**\n\n\n### Install with NPM\n\n`npm install coreui-table`\n\n### Example usage\n\n![Preview](https://raw.githubusercontent.com/n2ref/coreui-table/master/preview.png)\n\n```html\n\u003cdiv id=\"table-all\"\u003e\u003c/div\u003e\n\n\u003cscript\u003e\n    let tableAll = CoreUI.table.create({\n        id: \"table-id\",\n        class: 'table-bordered',\n        lang: \"ru\",\n        width: '100%',\n        minWidth: '100%',\n        maxWidth: '100%',\n        height: 550,\n        minHeight: 550,\n        maxHeight: 550,\n        show: {\n            showHeaders: true,\n            total: true\n        },\n        controls: [\n            { type: \"link\",   content: \"Добавить\", href: \"#\",                attr: { class: 'btn btn-sm btn-success' } },\n            { type: \"button\", content: \"Удалить\", onClick: function (e) { }, attr: { class: 'btn btn-sm btn-warning' } },\n            { type: \"custom\", content:\n                        '\u003cdiv class=\"form-check\"\u003e' +\n                        '\u003cinput class=\"form-check-input\" type=\"checkbox\" id=\"gridCheck2\"\u003e' +\n                        '\u003clabel class=\"form-check-label\" for=\"gridCheck2\"\u003eCheck me\u003c/label\u003e' +\n                        '\u003c/div\u003e'\n            }\n        ],\n        columnGroups: [\n            [\n                { label: '', attr: { rowspan: 2, colspan: 2 }  },\n                { label: 'General Information', attr: { colspan: 7 } },\n            ],\n            [\n                { label: 'Full name', attr: { colspan: 3 } },\n                { label: 'Important Dates', attr: { colspan: 4, class: \"text-center\" } }\n            ]\n        ],\n        columns: [\n            { type: 'numbers'},\n            { type: 'select'},\n            { type: 'text',    field: 'fname', label: 'First Name', width: '15%'},\n            { type: 'text',    field: 'lname', label: 'Last Name',  width: '15%'},\n            { type: 'text',    field: 'email', label: 'Email' },\n            { type: 'date',    field: 'sdate', label: 'Start Date', width: 120, format: 'DD/MM/YYYY', attr: { class: 'text-end' }, attrHeader: { class: 'text-end' }},\n            { type: 'date',    field: 'edate', label: 'End Date',   width: 120, format: 'DD/MM/YYYY', attr: { class: 'text-end' }, attrHeader: { class: 'text-end' }},\n            { type: 'number',  field: 'diff',  label: 'Diff Date',  width: 90,  attr: { class: 'text-end' }, attrHeader: { class: 'text-end' },\n                render: function (record) {\n                    const date1 = new Date(record.sdate);\n                    const date2 = new Date(record.edate);\n                    const diffTime = Math.abs(date2 - date1);\n                    return Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n                }\n            },\n            { type: 'switch', field: 'is_active_sw', label: 'On', valueY: 1, valueN: 0,\n                onChange: function (record, value) {\n                    console.log(record);\n                    console.log(value);\n                }\n            },\n        ],\n        footer: [\n            [\n                { label: 'Total', attr: { colspan: 7, class: 'text-end' } },\n                { label: '123',   attr: { class: 'text-end' } },\n                { label: '' },\n            ]\n        ],\n        onClick: function (event, record) {\n            console.log(record)\n        },\n        onClickUrl: \"#/path/to/object/[id]\",\n        records: [\n            { id: 1,  fname: 'Jane',    lname: 'Doe',         email: 'jdoe@gmail.com',     sdate: '2023-04-03', edate: '2023-12-03', is_active_sw: \"N\" },\n            { id: 2,  fname: 'Stuart',  lname: 'Motzart',     email: 'jdoe@gmail.com',     sdate: '2023-04-03', edate: '2023-11-03', is_active_sw: \"N\" },\n            { id: 3,  fname: 'Jin',     lname: 'Franson',     email: 'peter@gmail.com',    sdate: '2023-04-03', edate: '2023-04-03', is_active_sw: \"Y\" },\n            { id: 4,  fname: 'Susan',   lname: 'Ottie',       email: 'frank@gmail.com',    sdate: '2023-09-03', edate: '2023-10-03', is_active_sw: \"Y\" },\n            { id: 5,  fname: 'Kelly',   lname: 'Silver',      email: 'jdoe@gmail.com',     sdate: '2023-04-03', edate: '2023-06-24', is_active_sw: \"Y\" },\n            { id: 6,  fname: 'Francis', lname: 'Gatos',       email: 'jdoe@gmail.com',     sdate: '2023-02-03', edate: '2023-06-03', is_active_sw: \"N\" },\n            { id: 7,  fname: 'Mark',    lname: 'Welldo',      email: 'susan@gmail.com',    sdate: '2023-04-03', edate: '2023-06-23', is_active_sw: \"N\" },\n            { id: 8,  fname: 'Thomas',  lname: 'Bahh',        email: 'david@gmail.com',    sdate: '2023-04-03', edate: '2023-09-16', is_active_sw: \"N\" },\n            { id: 9,  fname: 'Sergei',  lname: 'Rachmaninov', email: 'magi@gmail.com',     sdate: '2023-04-03', edate: '2023-04-03', is_active_sw: \"N\" },\n            { id: 10, fname: 'Jill',    lname: 'Doe',         email: 'jdoe@gmail.com',     sdate: '2023-04-03', edate: '2023-04-03', is_active_sw: \"N\" },\n            { id: 11, fname: 'Frank',   lname: 'Motzart',     email: 'peterson@gmail.com', sdate: '2023-04-03', edate: '2023-04-03', is_active_sw: \"N\" },\n            { id: 12, fname: 'Peter',   lname: 'Franson',     email: 'jdoe@gmail.com',     sdate: '2023-04-03', edate: '2023-08-03', is_active_sw: \"N\" },\n            { id: 13, fname: 'Andrew',  lname: 'Ottie',       email: 'magi@gmail.com',     sdate: '2023-04-03', edate: '2023-06-19', is_active_sw: \"N\" },\n            { id: 14, fname: 'Manny',   lname: 'Silver',      email: 'jdoe@gmail.com',     sdate: '2023-04-03', edate: '2023-08-05', is_active_sw: \"N\" },\n            { id: 15, fname: 'Ben',     lname: 'Gatos',       email: 'peter@gmail.com',    sdate: '2023-04-03', edate: '2023-09-03', is_active_sw: \"N\" },\n            { id: 16, fname: 'Doer',    lname: 'Welldo',      email: 'magi@gmail.com',     sdate: '2023-04-03', edate: '2023-04-07', is_active_sw: \"N\" },\n            { id: 17, fname: 'Shashi',  lname: 'Bahh',        email: 'jdoe@gmail.com',     sdate: '2023-04-03', edate: '2023-04-03', is_active_sw: \"N\" },\n            { id: 18, fname: 'Av',      lname: 'Rachmaninov', email: 'joe@gmail.com',      sdate: '2023-09-03', edate: '2023-12-06', is_active_sw: \"N\" },\n            { id: 19, fname: 'John',    lname: 'Doe',         email: 'jdoe@gmail.com',     sdate: '2023-09-03', edate: '2023-12-06', is_active_sw: \"N\" ,\n                _meta: {\n                    attr: { class: 'table-row' },\n                    fields: {\n                        fname: {\n                            attr: { style: 'font-weight: bold', class: 'cell' },\n                        }\n                    },\n                }\n            }\n        ]\n    });\n\n    $('#table-all').html(tableAll.render());\n    tableAll.initEvents();\n\u003c/script\u003e\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn2ref%2Fcoreui-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn2ref%2Fcoreui-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn2ref%2Fcoreui-table/lists"}