survos/grid-bundle

incorporate DatatablesNet, using twig and stimulus, twig_component requires ^2.3

Maintainers

👁 tacman1123

Package info

github.com/survos/SurvosGridBundle

Language:JavaScript

Type:symfony-bundle

pkg:composer/survos/grid-bundle

Fund package maintenance!

kbond

Statistics

Installs: 1 874

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.5.139 2024-02-02 19:34 UTC

Requires (Dev)

Suggests

Provides

None

Conflicts

Replaces

None

MIT 3b33b4f48b44d900d8d6da573bfe06d838215a76

  • Tac Tacelosky <tacman.woop@gmail.com>

symfony-uxsymfony6

This package is auto-updated.

Last update: 2026-06-29 02:02:06 UTC


README

Use the DataTables.net javascript library with Symfony, Twig.

composer req survos/grid-bundle

Ideas

Import the datasets at https://domohelp.domo.com/hc/en-us/articles/360043931814-Fun-Sample-DataSets https://www.mytechylife.com/2015/09/29/next-and-previous-row-with-jquery-datatables/ https://github.com/lerocha/chinook-database http://2016.padjo.org/tutorials/sqlite-data-starterpacks/#more-info-simplefolks-for-simple-sql

Dev only...

composer config repositories.survos_grid_bundle '{"type": "vcs", "url": "git@github.com:survos/SurvosGridBundle.git"}'

symfony new grid-demo --webapp --version=next --php=8.2 && cd grid-demo
composer config extra.symfony.allow-contrib true
composer req symfony/asset-mapper symfony/stimulus-bundle:2.x-dev
composer req survos/grid-bundle survos/scraper-bundle

# make it prettier with bootstrap, but not necessary
bin/console importmap:require bootstrap
echo "import 'bootstrap/dist/css/bootstrap.min.css'" >> assets/app.js

bin/console make:controller grid -i
cat > templates/grid.html.twig <<END
{% extends 'base.html.twig' %}

{% block body %}
 {% set data = request_data('https://jsonplaceholder.typicode.com/users') %}
 <twig:grid :data="data" :columns="data[0]|keys">
 <twig:block name="id">
 {{ row.id }}
 </twig:block>
 <twig:block name="title">
 <i>{{ row.title }}</i>
 </twig:block>
 </twig:grid>
 </table>
{% endblock %}
END
symfony server:start -d
symfony open:local --path=/grid