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 | 269319 | J6DN2T8XZ-A53RX8ZHE-UMJLLA0XN | 1.44 | No | View Edit Remove | |
2 | 269319 | J9I98UF87-A6RBYHYTE-URJG5G49N | 1.44 | No | View Edit Remove | |
3 | 269319 | JHYSQ2Z4N-AB8DYMXHE-V51SZ3AXN | 1.44 | No | View Edit Remove | |
4 | 269319 | L2VTFAZ1J-B5C07J0TE-XNY471U9N | 1.44 | No | View Edit Remove | |
5 | 269319 | LZB3JN9ON-BMHBHGRHE-Z3QA374XN | 1.44 | No | View Edit Remove | |
6 | 269319 | MYYXF28G4-C5C9O7HHY-3O2GGR7LN | 1.44 | No | View Edit Remove | |
7 | 269319 | NIFMY6UH3-CFMU4D25E-3R6D0LRK6 | 1.44 | No | View Edit Remove | |
8 | 269319 | OF4FW4C6V-CWX6P42TE-3WEAR6R86 | 1.44 | No | View Edit Remove | |
9 | 269319 | PCWBXTQ5Z-DES7F0THE-41SH7KDW6 | 1.44 | No | View Edit Remove | |
10 | 269319 | PGMGFVUP3-DGR4YFE5E-42DWBTLK6 | 1.44 | No | View Edit Remove |