Adding Title attribute and button states to Colvis button options

Adding Title attribute and button states to Colvis button options

bhushansp10bhushansp10 Posts: 3Questions: 0Answers: 0

Hi,

We are using datatables in our application, and having difficulty adding "Title" attribute and button states to button options under primary Colvis button as shown in the attached image.

Could you please share your thoughts on how to accomplish this. Thank you very much in advance.

Thanks

Replies

  • allanallan Posts: 54,914Questions: 1Answers: 8,608 Site admin

    When using colVis there is no way to control the title attribute (without changing the library code, which you could do) I'm afraid.

    If you know what the columns are though perhaps you could go the custom button route which would let you have complete control over what the button does, its state and attributes. It would be more verbose in the code, but it would allow full control.

    Allan

  • bhushansp10bhushansp10 Posts: 3Questions: 0Answers: 0

    Hi Allan,

    Thank you very much for your quick response. I really appreciate it.

    When you mentioned "When using colVis there is no way to control the title attribute (without changing the library code, which you could do)" could you please mention exactly on what part of the library code needs to be modified. I would like to give this a try.

    Thanks a lot again for your suggestions.

  • allanallan Posts: 54,914Questions: 1Answers: 8,608 Site admin

    This is the base button that is used for the column visibility buttons. In its init function you can manipulate the button, including adding attributes.

    Allan

  • bhushansp10bhushansp10 Posts: 3Questions: 0Answers: 0

    Hi Allan,

    Thank you very much for your suggestions. I was able to add title attributes to the buttons based on your guidance. Could you please advise me on how to add button state attributes dynamically to the ColVis buttons. (ex: active, inactive) when the ColVis Buttons are clicked. I would really appreciate if you could mention exactly what part of the library code needs to be modified to add this attribute.

    Thanks again.

  • allanallan Posts: 54,914Questions: 1Answers: 8,608 Site admin

    This is its action function. That is what is run when the button is triggered (be it by click or the keyboard). You could modify the button there based on the state if you needed.

    Another option, if you don't want to modify the library code for that, is to use the buttons.action event. It triggers once that function has completed.

    Allan

Sign In or Register to comment.