Topic: Find all checked ckeckboxes in a datatable
Hi,
I have the same datatable as your example with a checkbox in every row. How can i get all checked checkboxes on all rows of the datatable regardless of the datapage they are located?
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Resolved
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.5.10
- Device: Pc
- Browser: Ie and Firefox
- OS: Win 10
- Provided sample code: No
- Provided link: No
Piotr Glejzer staff commented 6 years ago
Hi,
is that what you want?
dmermigas pro commented 6 years ago
Partially correct. This shows the checked items on the currenct page only! I want to find the checked items in the whole datatable regardless the page they are. The result i am aiming at is checked_items = "ID1, ID2, ID15,..."
dmermigas pro commented 6 years ago
Hi,
I found how to return all checked checkboxes ids in a comma separated field in a datatable regardless the page they are.
var table = $('#MyTable').DataTable();
var checkedvalues = table.$('input:checked').map(function () {
return this.id;
}).get().join(',');
Piotr Glejzer staff commented 6 years ago
Cool. I'm happy that you find a solution. I have an another for that but I think your is better.