DataTables Bundle for Symfony2

DataTables Bundle for Symfony2

I thought this might be a good place to make a generic announcement. I am creating a bundle for Symfony2 and Doctrine2 to act as the server side for DataTables. The idea is to configure a DataTables 'model' on the server side and provide it with either a QueryBuilder or an array of data. The rest, sorting, paging, filtering gets translated and added onto the QueryBuilder.

Replies

Very nice! Symfony is something that I've been wanting to get to grips with for some time, so this might be just the ticket for me personally to get my feet wet, and I'm sure others will find it useful as well.

I've added your release to the DataTables news feed and moved your post to the announcements category.

One other thing I would say, the work I've been doing on DataTables 1.10 recently has been to revamp how the server-side communication protocol for DataTables works - this change is 100% backwards compatible, so all scripts that use the 1.9- scheme will continue to work! However, I mention it as it might possibly make your own development a little bit easier... For example, arrays are used to send column information rather than `bSortable_{i}` like parameters. Also, like the rest of 1.10 it is camelCase. If you are interested, let me know and I'll provide some more details, but as I say, the old SSP method will continue to work and will do so for the rest of the 1.x series (which is into the foreseeable future!).

That sounds like a great idea. It sounds like you have done some of this before.

I am thinking out-loud but, this brings up some design considerations to work through. It looks like there are three pieces of data that are required to accomplish this: fnDrawCallback, aoColumnDefs, and aaSortingFixed. So, on the twig side we could add a parameter "groupByColumn" that takes an array (in case we want to allow more than one).

For the paramters; in the twig extension we could then merge aoColumnDefs with any specifically provided data and do the same thing to aaSortingFixed.

That just leaves fnDrawCallback. I want to figure out a way to combine the grouping functionality with any other custom functionality. ie. if I want it to group and I want to have additional functionality in fnDrawCallback, then I should be able to do both.

Have you considered extracting the server side/ajax portion of things from the Twig/rendering portions? I ask because the library seems well documented and thought out, but it doesn't work with my current setup.

I'm currently running a setup with DataTables + RequireJS, so having Twig handle my JS is out of the question. I believe having the server side/ajax layer as a separate component would make this library that much more functional.

I am certainly not against that, I would say that we could split them and allow for configurable front ends and have the default bundle use composer tie them together. Is this something you would be willing to help (at least define the interfaces if not more)? I dont use require js, but being able to use different engines is certainly appealing. Let me know and we can talk about accomplishing this.