Bulk Delete Bootstrap 4.5 theme
Bulk Delete - Select multiple records and delete. You cannot delete the record with a key : EBGC57SXM-VW47I6AF-401X7DYM
HIDE CODE
<?php $xcrud = Xcrud::get_instance(); $xcrud->table('million'); $xcrud->limit_list('20,50,100,1000'); // do not use 'all' for large tables $xcrud->bulk_select_position('left'); //It can be 'left' or 'right' $xcrud->set_bulk_select(false); $xcrud->set_bulk_select(false,'cd_key','=','EBGC57SXM-VW47I6AF-401X7DYM');//Dont be able to select records with ID 287846 $xcrud->unset_remove(true,'cd_key','=','EBGC57SXM-VW47I6AF-401X7DYM'); $xcrud->create_action('bulk_delete', 'bulk_delete'); // action callback, function publish_action() in functions.php echo $xcrud->render(); ?> <button class="btn btn-primary" onclick="deleteItems();">Delete Selected</button> <script> function deleteItems(){ var r = confirm("Confirm deletion of " + items.length + " items."); if (r == true) { Xcrud.request('.xcrud-ajax',Xcrud.list_data('.xcrud-ajax',{action: 'bulk_delete', task:'action',selected:items,table:'million',identifier:'id'})) items = []; } } </script>
Million
# | User Id | Cd Key | Sum | Activated | ||
---|---|---|---|---|---|---|
1 | 520608 | PUQSY33SL-BVKKMMT9B-Q2ODJZB21 | 13.92 | No | View Edit Remove | |
2 | 520608 | RHF2DZGJ1-CMIX1F4Z8-RPUN311ZS | 13.92 | No | View Edit Remove | |
3 | 520608 | S25UIHYF8-CW1Z8RF0F-SARSC65NT | 13.92 | No | View Edit Remove | |
4 | 520608 | TPK8HTZV1-DNCBQ45V8-TYOEF8E7S | 13.92 | No | View Edit Remove | |
5 | 520608 | WHXYW3OJ9-EXGFBZSF3-WRWXL9EIH | 13.92 | No | View Edit Remove | |
6 | 345780 | 3VZ9GCLZU-CKGDSX1DS-547HX7O41 | 14.09 | No | View Edit Remove | |
7 | 345780 | 42AF4AFCA-D4UMFFZSW-5CIFG8GXT | 14.09 | No | View Edit Remove | |
8 | 345780 | 47ZRTACQ2-DNADSQHHC-5K0NZGC8X | 14.09 | No | View Edit Remove | |
9 | 345780 | 4OBQSDM6I-F42VPDTOG-65IF02SIP | 14.09 | No | View Edit Remove | |
10 | 345780 | 4VFEYBFSA-FR1AA52WW-6EUVDAYPT | 14.09 | No | View Edit Remove |