Split button not working at all

Split button not working at all

khaoskhaos Posts: 47Questions: 11Answers: 0

I think the example @ https://datatables.net/reference/option/buttons.buttons.split may have some errors. If not then I missed something, which is highly likely.

action: function () { ... } },

{
    text: 'High priority',
    action: function () { console.log('High'); }, // Extra curly removed. 
    split: [
        //'pdf', // Missing comma added  
        { text: 'Medium priority', action: function () { console.log('Med'); } },
        { text: 'Low priority', action: function () { console.log('Low'); } }
    ],
},

With the extra curly table will not render.
With the 'pdf' line comma or not the table will not render.

As shown I get the 'High priority' button and it's function fires when clicked but there is no down arrow to show the other two buttons.

Test Case. Using v1.11.5
https://jsfiddle.net/BoozAllen/dv5qujoL/

Debugger link: https://debug.datatables.net/amuyoq

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794
    Answer ✓

    The problem is you are using buttons version 1.6.1. The docs state this feature is available "Since: Buttons 2.0.0". I upgraded your buttons code to show it working:
    https://jsfiddle.net/hsfx8ju6/

    @allan and @colin will appreciate and fix the type errors you noted.

    Kevin

  • khaoskhaos Posts: 47Questions: 11Answers: 0

    Thank you. I thought I was getting latest of everything.

Sign In or Register to comment.