A blog post on DT

A blog post on DT

josemotajosemota Posts: 17Questions: 0Answers: 0
edited September 2011 in Blog
Hi everyone,

I took the time to write a little about my experience with Datatables and would love some feedback from you guys. I honestly hope to contribute in a positive way and help make DT a better tool for everyone.

Here is the link: http://josemota.net/2011/09/does-datatables-need-better-integration/
Let me know what you have to say. Thanks!

Replies

  • allanallan Posts: 57,699Questions: 1Answers: 9,195 Site admin
    Hi josemota,

    Thanks very much for taking the time to write up your thoughts on these aspects of DataTables. Let me address each point:

    > Push data to the server without using fnServerData

    I fully agree! I've been thinking about this for a while, but you've prompted me to take action on it - I've just spent a bit of time on introducing a new callback function called fnServerParams (the initialisation option - internally it is an array which can be used by plug-in developers if they want). This function is executed on each request to the server, and is passed in the name/value data array that will be used to send the parameters to the server, so it can be manipulated as required.

    For example, previously to simply add a parameter to the request you would need to override fnServerData - you can now simply do this:

    [code]
    $('#example').dataTable( {
    "bServerSide": true,
    "sAjaxSource": "scripts/server_processing.php",
    "fnServerParams": function ( aoData ) {
    aoData.push( { "name": "more_data", "value": "my_value" } );
    }
    } );
    [/code]

    I've committed this in and it will be included in 1.8.2. It is available now as the 1.8.2.dev nightly from the downloads page: http://datatables.net/download .

    > Datatables’ features that have controls, such as MF, require a DOM object to be returned in the fnInit function

    If you don't want to return a DOM object when creating a feature plug-in, you can just return null and nothing will be added. This way you can add event handlers, or manipulate the table's DOM, without needing to insert a "dummy" node.

    I fully agree on the need to have more callbacks. In DataTables 2 I plan to use custom events for exactly this kind of thing and so we don't get completely swamped in callback functions!

    > There should clearly be some plugin development guidelines and I personally volunteer to help build those guidelines. Based on what I know, I would say there is a need to improve integration. If it’s not for how it’s built, it would by the way it’s told.

    Documentation is like software - it is never finished! Your help in putting together better documentation, particularly documentation for how to creating plug-ins for DataTables, would be very welcome indeed - not just by myself, but by the whole DataTables community I'm sure!

    There is a lot that can be done to improve DataTables and its documentation - with time being basically the only limiting factor for me personally. But with feedback such as your own, I can push forward on points which are important for the community as a whole and improve DataTables in the ways that are most beneficial to the project as a whole.

    Thanks for the feedback!

    Regards,
    Allan
This discussion has been closed.