{"id":20126048,"url":"https://github.com/inteve/datagrid","last_synced_at":"2025-05-06T17:34:53.653Z","repository":{"id":56992740,"uuid":"216009146","full_name":"inteve/datagrid","owner":"inteve","description":"Simple datagrid for Nette applications.","archived":false,"fork":false,"pushed_at":"2024-01-05T11:43:30.000Z","size":73,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T07:25:39.022Z","etag":null,"topics":["datagrid","nette","nette-component","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/inteve.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license.md","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},"funding":{"custom":"https://www.janpecha.cz/donate/"}},"created_at":"2019-10-18T11:29:00.000Z","updated_at":"2023-10-28T00:28:07.000Z","dependencies_parsed_at":"2024-11-13T14:36:41.290Z","dependency_job_id":null,"html_url":"https://github.com/inteve/datagrid","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"ff86e89ece71dbfa8fa63091319f829634778145"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Fdatagrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Fdatagrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Fdatagrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Fdatagrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inteve","download_url":"https://codeload.github.com/inteve/datagrid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252734456,"owners_count":21796020,"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":["datagrid","nette","nette-component","php"],"created_at":"2024-11-13T20:13:02.750Z","updated_at":"2025-05-06T17:34:53.397Z","avatar_url":"https://github.com/inteve.png","language":"PHP","funding_links":["https://www.janpecha.cz/donate/"],"categories":[],"sub_categories":[],"readme":"# Inteve\\Datagrid\n\n[![Build Status](https://github.com/inteve/datagrid/workflows/Build/badge.svg)](https://github.com/inteve/datagrid/actions)\n[![Downloads this Month](https://img.shields.io/packagist/dm/inteve/datagrid.svg)](https://packagist.org/packages/inteve/datagrid)\n[![Latest Stable Version](https://poser.pugx.org/inteve/datagrid/v/stable)](https://github.com/inteve/datagrid/releases)\n[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/inteve/datagrid/blob/master/license.md)\n\nDataGrid component for Nette.\n\n\u003ca href=\"https://www.janpecha.cz/donate/\"\u003e\u003cimg src=\"https://buymecoffee.intm.org/img/donate-banner.v1.svg\" alt=\"Donate\" height=\"100\"\u003e\u003c/a\u003e\n\n\n## Installation\n\n[Download a latest package](https://github.com/inteve/datagrid/releases) or use [Composer](http://getcomposer.org/):\n\n```\ncomposer require inteve/datagrid\n```\n\nInteve\\Datagrid requires PHP 7.2.0 or later.\n\n\n## Usage\n\nIn presenter:\n\n``` php\nclass MyPresenter extends Nette\\Application\\UI\\Presenter\n{\n\tprotected function createComponentGrid()\n\t{\n\t\t$datasource = new Inteve\\DataGrid\\DataSources\\LeanMapperQuery($this-\u003erepository-\u003equeryAll(), $this-\u003emapper);\n\t\t$grid = new Inteve\\DataGrid\\DataGrid($datasource);\n\t\t$grid-\u003esetTemplateFile(__DIR__ . '/@grid.latte'); // optional\n\t\t$grid-\u003esetItemsOnPage(20, TRUE); // optional\n\n\t\t$grid-\u003eaddTextColumn('title', 'Title')\n\t\t\t-\u003esetCustomRender(function (Entity\\Post $post) {\n\t\t\t\t$label = Html::el();\n\t\t\t\t$label-\u003eaddText($post-\u003etitle);\n\t\t\t\treturn $label;\n\t\t\t})\n\t\t\t-\u003esetSortable();\n\n\t\t$grid-\u003eaddLinkColumn('url', 'URL');\n\n\t\t$grid-\u003eaddDateColumn('date', 'Date')\n\t\t\t-\u003esetSortable();\n\n\t\t$grid-\u003eaddNumberColumn('views', 'Views')\n\t\t\t-\u003esetSortable()\n\t\t\t-\u003esetDecimals(1)\n\t\t\t-\u003esetValueProvider(function (Entity\\Post $post) {\n\t\t\t\treturn max(1, $post-\u003eviews);\n\t\t\t});\n\n\t\t$grid-\u003eaddAction('edit', 'Upravit', $this-\u003elazyLink('edit'));\n\n\t\t$grid-\u003eaddAction('delete', 'Smazat', $this-\u003elazyLink('delete!'));\n\n\t\t$grid-\u003eaddTextFilter('title', 'Title');\n\n\t\t$grid-\u003eaddTextFilter('url', 'URL');\n\n\t\t$grid-\u003esetDefaultSort(array(\n\t\t\t'date' =\u003e 'DESC',\n\t\t\t'title' =\u003e 'ASC',\n\t\t));\n\n\t\treturn $grid;\n\t}\n}\n```\n\nIn template:\n\n```latte\n{control grid}\n```\n\n------------------------------\n\nLicense: [New BSD License](license.md)\n\u003cbr\u003eAuthor: Jan Pecha, https://www.janpecha.cz/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteve%2Fdatagrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finteve%2Fdatagrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteve%2Fdatagrid/lists"}