Custom Buttons

Custom Buttons

dkbergstromdkbergstrom Posts: 3Questions: 0Answers: 0
edited August 2011 in TableTools
I have some custom buttons positioned in a particular place that I would like to bind the functionality of TableTools to them. At first I was outputting the HTML snagged from source and removing the entire container during fnComplete. This worked great for NON-IE browsers (using embed), but IE does not use embed properly. TableTools switches to object tags for IE, so my next thought was moving the embed/object tags upon completion by adding code to the fnComplete parameter.

TableTools is not fully initialized at the time fnComplete is executed. The buttons are in place, but the embed/object tags have not been registered with the DOM.

Any ideas on how I can tell the embed/object tags have been created and then move the tags to their new homes?

--

On a separate minor issue. It seams when thead has two rows the language for "copied x rows" is one shy of the actual number of rows in tbody. If I have 4 rows and click the button 4 rows are copied, but the alert indicates only 3 rows were copied.

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    There isn't really an API designed for that with TableTools - there isn't a method to farm the Flash buttons out. It is of course possible, but you would probably need to write that code yourself. However, is there a reason you can't use the TableTools buttons? You could just move them around hte DOM as you need and style using CSS. This API method might also be useful if you resize the buttons: http://datatables.net/extras/tabletools/api#fnResizeButtons

    > On a separate minor issue. It seams when thead has two rows the language for "copied x rows" is one shy of the actual number of rows in tbody

    Can you try the TableTools nightly ( http://datatables.net/download ). It should be fixed there :-)

    Allan
  • dkbergstromdkbergstrom Posts: 3Questions: 0Answers: 0
    Thanks for your quick response.

    Buttons
    --
    I prefer to use unordered lists with a and span tags for the actually buttons. I have a few other buttons related to the table I would like to keep grouped together, such as toggling the tfoot tags.

    If I wait until these items have been rendered I can move them and style them accordingly. At this point it just comes down to timing.

    Is it possible to add a hook to TableTools, or DataTables, once the DOM has finished rendering the object / embed tags?


    Row Count
    --
    Downloaded the nightly builds of TableTools and DataTables. Both pre and post filter produces one less row than expected still.
  • dkbergstromdkbergstrom Posts: 3Questions: 0Answers: 0
    edited August 2011
    Is this a feature that needs to be built through donating / buying development time?
This discussion has been closed.