Custom Button on TableTools renders button element as (see live example)

Custom Button on TableTools renders button element as (see live example)

rgvcorleyrgvcorley Posts: 29Questions: 0Answers: 0
edited June 2012 in TableTools
This is the HTML generated for the button in the live example:-


Copy to div


The live example is here:- http://datatables.net/release-datatables/extras/TableTools/plug-in.html

Replies

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    Thanks for pointing that out! I thought I had gone through all of the examples before the 2.1.2 release, but I clean missed that one. The issue is not with TableTools itself, but rather the example: the fundamental issue (should yourself or anyone else be interested) was that sTag must be defined for the buttons now, as this tells TableTools what HTML element to create for the button - since it wasn't defined in my example 'undefined' was the result!

    What I've done in TableTools 2.1.2 is to introduce a new object called 'TableTools.buttonBase' which provides defaults for all of the button parameters TableTools knows about. The best way to create a button plug-in for TableTools is thus to extend that object, which I have now done in that example.

    Regards,
    Allan
  • rgvcorleyrgvcorley Posts: 29Questions: 0Answers: 0
    Spot on, thanks for the lightning fast response!

    Note that you've updated the actual code on the example but the code displayed on the page is still the old version.
  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin
    It appears my computer has been asking for the last 30 minutes if I want it overwrite the old file or not. Doh! It has now :-)

    Allan
This discussion has been closed.