Datatable expand button
https://imgur.com/a/Avix6It
hello, Can the expand button for datatable responsive be taken to the column we want?
Replies (2)
I want to take the expand button to the far right.
I need to solve it urgently, I will apply it to the project.
Hi,
We will release this feature in the next update. At the moment to implement it please follow the below steps:
1) Go to src/sass/vendors/plugins/_datatables.scss
and update this file with this version.
2) Use this JS code to initialize your datatable:
$("#kt_datatable_responsive_2").DataTable({
responsive: {
details: {
type: "column",
target: -1
}
},
columnDefs: [
{
className: "dtr-control dtr-control-last",
orderable: false,
targets: -1
}
]
});
3. Use below format for the table:
<table class="table table-striped border rounded gy-5 gs-7">
<thead>
<tr class="fw-semibold fs-6 text-gray-800">
<th class="min-w-150px" data-priority="2">Name</th>
<th class="min-w-250px">Position</th>
<th class="min-w-250px">Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
<th class="mw-25px" data-priority="1"></th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
<td></td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
<td></td>
</tr>
</tbody>
</table>
Then recompile your assets folder with Gulp or Webpack.
Please note that the build tools are required only in the development environment just to compile the assets when the source folder files are modified. In the hosting/server deployment you will only need the compile assets, no need to install the build tools dependencies there.
Regards.