Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Does MultiselectColumn require or use the Select extension? #986

Open
craigh opened this issue Jun 7, 2022 · 2 comments
Open

Does MultiselectColumn require or use the Select extension? #986

craigh opened this issue Jun 7, 2022 · 2 comments

Comments

@craigh
Copy link

craigh commented Jun 7, 2022

Support question

The docs are not clear of any requirement or interaction between the MultiselectColumn and the DataTables Select Extension.

Does one require the other? Can I use Select without Multiselect?

@craigh
Copy link
Author

craigh commented Jun 8, 2022

ok, so I see that indeed you can implement a MultiSelectColumn with or without the Select extension. (I currently have it without), now my question is how to make the 'select all' checkbox in the header work?

Screen Shot 2022-06-08 at 8 21 14 AM

Bug

Should this work 'out of the box' or do I need to write my own JS?

I see that The Select extension includes some buttons for select all/none - but I was trying to see if that is now required for this functionality.

I am using datatables.net 1.10.25 and sg/datatablesbundle v1.3.0

I look forward to your response. thank you!

@craigh
Copy link
Author

craigh commented Jun 25, 2022

refs #662 (comment)

Possible Bugfix

I have found that

$("#sg-datatables-{{ datatable_name }}").on("click", "input.sg-datatables-{{ datatable_name }}-multiselect-checkall:checkbox", function () {

and

var cbox_checkall = $("#sg-datatables-{{ datatable_name }} input.sg-datatables-{{ datatable_name }}-multiselect-checkall:checkbox");

need to be changed. In both cases, the selector needs to be changed from

$("#sg-datatables-{{ datatable.name }}")

to

$("#sg-datatables-{{ datatable.name }}_wrapper")

after that change, the select all/none checkbox at the top of the table works as expected and also the action buttons at the bottom enable/disable as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant