user defined button

user defined button

MadMax76MadMax76 Posts: 149Questions: 33Answers: 1

I try to figure out how to create a button like this:

buttons: [
       { extend: 'selectedSingle',
         text: 'Kopieren',
             editor: editor,
         action: function ( data ) {
             ajax_call('__plugName__', 'kopieren', data.AR_Header.Re_Nummer_intern); }},
the column
{data: "AR_Header.Re_Nummer_intern"}, //4


does exist and works - but in the function I try to call there is no value showing. I also tried data.column(4) and other things, none worked....


This question has an accepted answers - jump to answer


  • kthorngrenkthorngren Posts: 20,237Questions: 26Answers: 4,756

    The buttons.buttons.action docs explain the parameters used for the custom button function. There is no data parameter passed. You will need to get the selected row via the API. See the docs for selectedSingle for how to get the row data.


  • MadMax76MadMax76 Posts: 149Questions: 33Answers: 1

    Hi Kevin,

    thanks, but none of the links (and some further search) provides an example of a single field to be read - all go for the whole row.



  • colincolin Posts: 15,141Questions: 1Answers: 2,586
    edited September 2021 Answer ✓

    You can use the selector-modifier value of {selected: true}, something like:

    action: function ( ) {
        let data = table.row({selected: true}).data();
        ajax_call('__plugName__', 'kopieren', data.AR_Header.Re_Nummer_intern); }},


Sign In or Register to comment.