{"id":23269168,"url":"https://github.com/zdunecki/jaytable","last_synced_at":"2025-04-06T09:14:26.891Z","repository":{"id":217965304,"uuid":"64414879","full_name":"zdunecki/jaytable","owner":"zdunecki","description":"from json to table","archived":false,"fork":false,"pushed_at":"2016-07-28T23:23:35.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T14:30:51.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zdunecki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-28T17:26:19.000Z","updated_at":"2016-07-28T17:30:56.000Z","dependencies_parsed_at":"2024-01-19T00:05:03.637Z","dependency_job_id":null,"html_url":"https://github.com/zdunecki/jaytable","commit_stats":null,"previous_names":["zdunecki/jaytable"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdunecki%2Fjaytable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdunecki%2Fjaytable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdunecki%2Fjaytable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zdunecki%2Fjaytable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zdunecki","download_url":"https://codeload.github.com/zdunecki/jaytable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457809,"owners_count":20941906,"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-12-19T17:48:31.052Z","updated_at":"2025-04-06T09:14:26.874Z","avatar_url":"https://github.com/zdunecki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jaytable\nfrom json to table\n\n##Usage\n\n```javascript\n\u003cscript type=\"text/javascript\" src=\"build/jaytable.min.js\"\u003e\u003c/script\u003e\nvar demo = new JayTable();\n```\n### Build by JSON\n\n```javascript\ndemo.jay(jsonfile)\n```\n### or with upload \n```html\n\u003cinput type=\"file\" id=\"jaytableFile\"/\u003e\n\u003cbutton id=\"createJayTable\"\u003eClick\u003c/button\u003e\n```\n```javascript\nvar file = document.getElementById(\"jaytableFile\");\nvar btn = document.getElementById(\"createJayTable\");\ndemo.uploadjay(file,btn)\n```\n\n###Events\n```javascript\ndemo.on('uploadsuccess',function(event,data){\n//some stuff on upload success\n});\n\ndemo.on('uploadfailure',function(event){\n//some stuff on upload fail\n});\n\ndemo.on('jaysuccess',function(event,data){\n//some stuff on success convert json \n});\n\ndemo.on('jayfailure',function(event){\n//some stuff on fail convert json \n});\n```\n###### JSON as table\n```\n{\n\"titles\": [  \u003c----- ---- it's our thead\n        [   \u003c----- ---- need one array for thead tr element\n            { \u003c------------------------| Ob.A1\n                \"title\": \"JayTableA\" 1 |\n            },                         |------  each object return td element for thead.\n            {                        2 | Ob.A2     title is our key for td elements \n                \"title\": \"JayTableB\"   |\n            } \u003c------------------------|\n        ]\n    ], \n    \"elements\": [ \u003c--------  it's our tbody \n            { \u003c-------------------------------| Ob.B1\n            \"columns\": [                      |                   \n              {  Ob.B1C1                      |\n                \"row\":\"JayTable is Awesome\"   |\n              },                              |------  each object return tr element\n              {  Ob.B1C2                      |       for example it's our first tr\n                \"row\":\"JayTable is Awesome!\"  |\n              }                               |\n            ]                                 |\n           },\u003c--------------------------------|\n           { \u003c--------------------------------- Ob.B2  there is our next tr element \n            \"columns\": [  \n              {\u003c--------------------------------| Ob.B2C1\n                \"row\":\"JayTable is Awesome 2\"  1|\n              },                                |-------  each objects return tbody td elements\n              {                                 | Ob.B2C2\n                \"row\":\"JayTable is Awesome 2!\" 2|\n              }\u003c--------------------------------|\n            ]\n           }\n      ]\n}\n```\n\n## Specification\n* Must return only 2 main array's like titles,elements (look at top)\n* First and second array like titles and elements (look at top) must return ONE array\n* Each objects return one element, you can't pass few element's for one object\n* Ob.A1, Ob.A2 .. Ob.A(n) return tr for thead (look at top)\n* Ob.B1, Ob.B2 .. Ob.B(n) return tr for tbody (look at top)\n* Ob.B1C1, Ob.B2C1 ..Ob.B(n)C(n) return td for tr-tbody (look at top)\n* Each key for one element **must have** the same name\n* You have free namespaces for all elements: **titles,title,elements,columns,rows** (look at top)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdunecki%2Fjaytable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzdunecki%2Fjaytable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzdunecki%2Fjaytable/lists"}