How can I add a custom button/link to datatables

How can I add a custom button/link to datatables

monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
edited May 2012 in General
I want to add to the layout so to speak on some of my tables, and I havent found a good way to do it. I tried to understand "sDom" but failed at that.

What I have is moved the "info" to the right and I want something where it was to act as a link/button on the left. So basically lower left right below the table itself. Any ideas?

Replies

  • monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
    figured my own deal out. Maybe not the best approach but it works nicely for my cause.

    [code]$('#'+tableID).parents('.dataTables_wrapper').find('.dataTables_info').css({"clear":"none","margin":"6px"}).after('Refresh');[/code]
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Good to hear you got a solution.

    There are a couple of ways of doing what you want:

    1. You could use TableTools, which is designed specifically to allow flexible buttons to be added to DataTables

    2. Create a feature plug-in to add a button using sDom (and then positioning would be with a bit of CSS)

    3. Do what you did :-)

    Regards,
    Allan
This discussion has been closed.