Submitted by diao on
Bonjour,
Je suis un peu nouveau dans le développement des modules avec Drupal, j'ai attaché un fichier JavaScript a mon thème pour pouvoir empecher une selection multiple des cases a chocher. a la premiere partie de la table tout va bien mais quand je selectionne une autre page de la table mon JavaScript ne fonctionne plus.
Avez vous une idée de ce qui pourrait me sortir de la?
Fichier JavaScript
(function ($, Drupal, Bootstrap){
jQuery(document).ready(function() {
var limitSelection = function () {
$("input[type=checkbox]").on("click", function () {
if ($(this).prop('checked')) {
$("input[type=checkbox]").each(function () {
if ($(this).prop('checked')) {
}
else {
$(this).prop('disabled', true);
}
});
}
else {
$("input[type=checkbox]").each(function () {
$(this).prop('disabled', false);
});
}
});
};
limitSelection();
//When the user paged the table @Class : parent of the table
$(".view-training-list-item-browser-search-api").on('change', function () {
console.log('Paged!');
limitSelection();
});
});
})(window.jQuery, window.Drupal, window.Drupal.bootstrap);
Fichier attaché | Taille |
---|---|
![]() | 159.78 Ko |