select_single and fnInit and fnSelect

select_single and fnInit and fnSelect

ansarigmbhansarigmbh Posts: 24Questions: 7Answers: 0
edited January 2015 in TableTools

Hi

I'm going to define a new button that when a row is selected becomes active so I have to use "select_single" option. When "fnInit" is being used, even if it is just an empty function , the button is activated despite no row has been selected on page refresh but there is no problem after that. Not using "fnInit", it works as it is expected but I have to use "fnInit" in my current implementation.

 "tableTools":
           {
           sSelectedClass: "row-selected info",
           sRowSelect: "os",
           sRowSelector: 'td.first-col-select',
           aButtons: [
                           {
                           sExtends: "select_single",
                           fnInit: function(nButton, oConfig)
                                     {
                                     },
                           sButtonClass: 'myClass',
                           sButtonText: 'myText'
                           }
         }

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Answer ✓

    Hi,

    This is correct as you are replacing the default fnInit action which will add the disabled class to the button (source).

    I know it isn't ideal and a rewrite of TableTools is planned to address many issues, including this, but that is how it works at the moment.

    So the fix is to add the disabled class in your own fnInit function.

    Allan

  • ansarigmbhansarigmbh Posts: 24Questions: 7Answers: 0

    Thanks for useful details

This discussion has been closed.