How can I add 'button type' and 'id' to DataTables button?

How can I add 'button type' and 'id' to DataTables button?

dataphpmysqldataphpmysql Posts: 65Questions: 17Answers: 0

I'm trying to change the 'button type' and add an 'Id' to a custom button I did. Here's the code:

                dom:
                    "<'row'<'col-sm-4'l><'col-sm-4 text-center'B><'col-sm-4'f>>" +
                    "<'row'<'col-sm-12'tr>>" +
                    "<'row'<'col-sm-5'i><'col-sm-7'p>>",
                buttons: [
                    {
                        text: 'Search',
                        className: 'xBtnDataTables',
                        action: function (e, dt, node, config) {
                            alert('Button activated');
                        }
                    }
                ]

I checked the docs and I've seen things you can add like className, text, action, extend but haven't seen how can I change the 'button type' and add an 'Id'. The end goal is that I'm trying to make that button a type=submit to submit a form when clicked, can this be done?

Thanks.

Answers

This discussion has been closed.