How to set background color for the buttons in TableTools?

How to set background color for the buttons in TableTools?

PWMPWM Posts: 3Questions: 0Answers: 0
edited February 2014 in TableTools
Thanks!

Replies

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Just use a little bit of CSS: https://github.com/DataTables/TableTools/blob/master/css/dataTables.tableTools.css#L61

    Allan
  • PWMPWM Posts: 3Questions: 0Answers: 0
    Thanks, Allan.

    How about different colors for different custom buttons? For example, NEW with blue background and DELETE with green.
  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Add a class using sButtonClass ( http://datatables.net/extras/tabletools/button_options#sButtonClass ) and then style that class as appropriate in your CSS.

    Allan
  • PWMPWM Posts: 3Questions: 0Answers: 0
    Thanks, Allan.

    How can these buttons be enabled / disabled?
  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    There actually isn't an API to enable and disable the buttons at the moment. Thinking about that, I can hardly believe it myself, that that's the case... I'll add it soon.

    Until then, you'd just use logic in your fnClick function to exit before taking action if required.

    Allan
This discussion has been closed.