We just moved over from using Materialize to using Bootstrap 4, and, being a total novice with Bootstrap, I've run into some complications with getting my function that checks the status of some checkboxes on one of our pages to work.
Here's my old code that worked with Materialize:
HTML:
{{#each relList}}
<div>
<input type="checkbox" id="{{this.eguid}}">
<label for="{{this.eguid}}">{{this.cluster_value}}</label>
</div>
{{/each}}
I'm using Meteor to iterate through "relList" and create a checkbox for each item in, with that checkbox having the same id as the current element.
jQuery:
$(document).ready(function () {
//getting eguid on checkbox change
$(":checkbox").change(function () {
var notChecked = [], checked = [];
$(":checkbox").map(function () {
this.checked ? checked.push(this.id) : notChecked.push(this.id);
});
getDetails(checked);
});
})
Here I'm listening for any changes to checkboxes and pushing the id of any checkbox that is changed into the arrays notChecked and checked, depending on whether the box was checked/unchecked.
I've done of the obvious of changing over the Materialize checkbox classes to Bootstrap ones, but for some reason my jQuery implementation doesn't seem to work with it no matter what I do. I'm not sure if my issue is with how I've converted over the HTML or if I need to make some changes to my jQuery.
If anyone could offer some insights into how to change my HTML/jQuery to get this working again, I would appreciate it.