Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

DataTable Export Button issue


My DataTable service code here

Public function html()
{

return $this->builder()
->setTableId('admin-countries-table')
->columns($this->getColumns())
->columns($this->getColumns())
->addColumnBefore([
'defaultContent' => '',
'data' => 'DT_RowIndex',
'name' => 'DT_RowIndex',
'title' => '#',
'render' => null,
'orderable' => false,
'searchable' => false,
'exportable' => false,
'printable' => true,
'footer' => '',
])
->minifiedAjax()
->stateSave(true)
->responsive()
->autoWidth(false)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
'dom' => 'lBfrtip',
'buttons' => [

[ 'text' =>' Add User', 'className' => 'btn-primary', 'init'=>'function(){removeClass(this)}','action'=>'function(){alert(1)}'] ,
['extend'=>'collection', 'text'=>'Export' ,'className' => 'btn-primary' ,'init'=>'function(){removeClass(this)}',
'buttons'=>['copy','excel','csv','pdf','print']
]

],

])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
NB : Please refer the below link for screenshot


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Adivinar,

We did try your code, the dropdown seems working. Could you please check the console log if there is any JS error?

<img src=" alt="image" border="0">


->parameters([
"scrollX" => true,
"drawCallback" => "function() { KTMenu.createInstances(); }",
"dom" => "lBfrtip",
"buttons" => [
["text" => " Add User", "className" => "btn-primary", "init" => "function(){}", "action" => "function(){alert(1)}"],
[
"extend" => "collection", "text" => "Export", "className" => "btn-primary", "init" => "function(){}",
"buttons" => ["copy", "excel", "csv", "pdf", "print"],
],
],
])


Thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(