Checkbox to select all entries of a datatable

This commit is contained in:
osaajani 2021-06-29 20:05:56 +02:00
parent 0e2908cb83
commit 05d488490a
14 changed files with 24 additions and 13 deletions

View File

@ -139,4 +139,15 @@ jQuery(document).ready(function()
form.trigger("reset");
});
});
jQuery('body').on('change', '.datatable #check-all', function (e) {
if (jQuery(e.target).is(':checked'))
{
jQuery(e.target).parents('.datatable').find('input[type="checkbox"]').prop('checked', true);
}
else
{
jQuery(e.target).parents('.datatable').find('input[type="checkbox"]').prop('checked', false);
}
});
});

View File

@ -44,7 +44,7 @@
<th>Début de l'appel</th>
<th>Fin de l'appel</th>
<th>Direction</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody></tbody>

View File

@ -42,7 +42,7 @@
<th>Nom</th>
<th>Script</th>
<th>Admin obligatoire</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -43,7 +43,7 @@
<th>Condition</th>
<th>Date de création</th>
<th>Dernière modification</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -46,7 +46,7 @@
<th>Numéro</th>
<th>Date de création</th>
<th>Dernière modification</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -43,7 +43,7 @@
<th>Date</th>
<th>Texte</th>
<?php if ($_SESSION['user']['admin']) { ?>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
<?php } ?>
</tr>
</thead>

View File

@ -43,7 +43,7 @@
<th>Nombre de contacts</th>
<th>Date de création</th>
<th>Dernière modification</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -43,7 +43,7 @@
<th>Nom</th>
<th>Type de téléphone</th>
<th>Callbacks</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -51,7 +51,7 @@
<th>Date</th>
<th>Status</th>
<th>Commande</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -41,7 +41,7 @@
<tr>
<th>Date</th>
<th>Contenu</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -44,7 +44,7 @@
<th>Message</th>
<th>Date</th>
<th>Statut</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody></tbody>

View File

@ -41,7 +41,7 @@
<tr>
<th>Numéro</th>
<?php if ($_SESSION['user']['admin']) { ?>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
<?php } ?>
</tr>
</thead>

View File

@ -43,7 +43,7 @@
<th>Admin</th>
<th>Statut</th>
<th>Crédit utilisé</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>

View File

@ -39,7 +39,7 @@
<tr>
<th>Url</th>
<th>Type de webhook</th>
<th class="checkcolumn">&#10003;</th>
<th class="checkcolumn"><input type="checkbox" id="check-all"/></th>
</tr>
</thead>
<tbody>