我是新来Ajax.I有一个jQuery的dataTable的一个RoR app.I必须参数传递给按钮,这样我可以选择的动作当按钮被点击时被执行。
var invoiceTable = $('#invoice_list_index').DataTable({
"scrollY": "300px",
"bScrollCollapse": true,
processing: true,
serverSide: true,
dom: 'Bfrtip',
buttons: [
{
extend: 'alert',
text: 'My button 1',
},
{
extend: 'alert',
text: 'My button 2'
},
{
extend: 'alert',
text: 'My button 3'
}
],
"ajax": {
type: "POST",
url: '/invoices/invoice_index_page',
}
});
<a class="dt-button buttons-alert" tabindex="0" aria-controls="invoice_list_index" href="#"><span>My button 1</span></a>
的问题是我不知道如何将参数传递到AJAX自定义按钮。
你想传递给这些按钮动作的参数是什么?那些表行数据还是其他? –