Customized control button modification

Customized control button modification

INTONEINTONE Posts: 153Questions: 58Answers: 6
edited July 2016 in Editor

Is it possible to have this example here https://editor.datatables.net/examples/api/triggerButton.html but with the ability to submit multiple rows at once. I tried this but only the first row is passed, even when multiple rows are selected:

buttons: [
                
                { extend: "edit",   editor: editor },
                {
                  extend: "selectRows",
                  text: "Submit Selected Item(s)",
                  action: function ( e, dt, node, config ) {
                      var workOb = request_count_table.row( { selected: true } ).data().work ;
                      console.log( workOb.work_id ); //only one value is logged even though multiple rows were selected.
                }

               
            ]

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,824Questions: 1Answers: 10,131 Site admin
    Answer ✓

    Sure - instead of extending the selectedSingle button type, you would extend selected and use rows() rather than row().

    You'd probably also need to use a little loop with multiGet and multiSet to set the values of each individual row, unless you want to set a common value, in which case just use val().

    Allan

This discussion has been closed.