DatatablesBundle
DatatablesBundle copied to clipboard
Extensions should be more dynamic
I'd like to use the FixedColumns extension, but that requires changing \Sg\DatatablesBundle\Datatable\Extensions
and Resources/views/datatable/extensions.html.twig
.
I can create a PR to add this feature, but I feel like this shouldn't be needed. I love OOP, but this seems over engineered. Configuring the OptionsResolver
and using Twig to generate JSON is quite overkill, isn't it?
As an example, see 87d122ce0f6c9a1d8541dbe189e6df7e9a8eb1ee. It's a very complex, inflexible and over-engineered way of printing a JSON string.
Replacing \Sg\DatatablesBundle\Datatable\Extensions
by an array makes more sense. Datatables.net's JS library should be use to handle configuration errors in this case.
What do you think?
I completely agree.
Moreover, this could improve the performance by avoiding including a lot of Twig templates.
Ping @stwe @Seb33300
Please let me know how you think about this idea. I'm willing to create a PR, but I'd like to know if this PR makes a chance in the first place.