Hide culumn and select on

Hide culumn and select on

pippuccio76pippuccio76 Posts: 19Questions: 10Answers: 0
edited December 2021 in Buttons

Hi sorry for english , i want to extract data from datatable but i have some select field(to change db with ajax) with this code i can simply export the selected text :

        var buttonCommon = {
            exportOptions: {



                format: {
                    body: function (data, row, column, node) {
                        // qui le colonne con le select
                        if (column == 14 || column==15 || column==16 || culumn ==17) {
                            return $(data).find("option:selected").text()
                        } else {

                          return data
                        }

                    }
                },

            }
        };

but i want extract some culumn :

            buttons: [ 

              //excel esporta tutto
              $.extend(
                true, 
                {}, 
                buttonCommon, 
                { 
                  extend: "excel", 
                  text: 'Esporta tutto Excel',
                  exportOptions: {
                    //columns: [  2,3,4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17 ],
                    },

                    modifier: {

                      selected: null
                    },

                  }
                }

              ), 

if i decomment //columns: [ 2,3,4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17 ], i have an error and don't work . How can i insert culumn to extract ?

Replies

Sign In or Register to comment.