Multi Select CheckboxNEW
1.7.28 Minimal theme
Create a multiselect with checkbox feature
HIDE CODE
<?php
$xcrud = Xcrud::get_instance();
if(isset($_SESSION["lang"])){
$xcrud->language($_SESSION["lang"]);
$language = $_SESSION["lang"];
}else{
$xcrud->language('en');
$language = "en";
}
$xcrud->table('base_fields');
$xcrud->fields("text");
$xcrud->set_attr("text",array("id"=>"my-select"));
$xcrud->fields_arrange("text","Text",true);
$xcrud->relation('text','products','productCode','productCode','','','multi');
echo $xcrud->render('create');
?>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js"></script>
<script>
$(document).ready(function() {
$('#my-select').multiselect({
includeSelectAllOption: true, // Adds 'Select All' option
buttonWidth: '100%' // Makes button width 100% for a wider dropdown
});
});
$(document).on("ready xcrudafterrequest", function(event, container)
{
$('#my-select').multiselect({
includeSelectAllOption: true, // Adds 'Select All' option
buttonWidth: '100%' // Makes button width 100% for a wider dropdown
});
});
</script>