gyrocode / jquery-datatables-checkboxes

Checkboxes is an extension for the jQuery DataTables library that provides universal solution for working with checkboxes in a table.
https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
MIT License
150 stars 61 forks source link

Doesn't show number of selected row in the footer. #96

Closed swim89 closed 5 years ago

swim89 commented 5 years ago

Hi, I can't see the number of selected row in my datatables.

In my html code I can see only this:

<div class="dataTables_info" id="customerTable_info" role="status" aria-live="polite">Showing 1 to 25 of 30 entries</div>

instead of <div class="dataTables_info" id="example_info" role="status" aria-live="polite">Showing 1 to 10 of 57 entries<span class="select-info"><span class="select-item">1 row selected</span></span></div>

I tried to copy only the code of the table and JS on JSFiddle and try there, but all works, not in my website.

What I have to looking for? Thanks

vancrypto commented 5 years ago

I have a similar, possibly related issue where the number of rows selected always says 1 no matter how many I select.

swim89 commented 5 years ago

@vancrypto to solve your problem, you have to fill the checkbox column with unique id. For example:

<td>id1</td>

mpryvkin commented 5 years ago

@swim89 Without the code and data, it's really hard to tell what is going on. Can you please share your DataTables initialization code and sample data?

vancrypto commented 5 years ago

Thanks @swim89 by adding a unique ID to the checkbox column the number of rows selected is displayed correctly.

swim89 commented 5 years ago

@mpryvkin if I copy my code on JSFiddle there isn't the problem, it is only on my project :(