Bulk Delete Default 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 | 454587 | HRGE8L7XB-ACX39HH8W-7523QSF66 | 6.79 | No | View Edit Remove | |
2 | 454587 | I1WKRZ6XR-AJ0H18GB4-799BSE8UM | 6.79 | No | View Edit Remove | |
3 | 454587 | I4KL3XWWV-AKKGPFU6O-7ABX7X9HQ | 6.79 | No | View Edit Remove | |
4 | 454587 | I8O3CATDE-AMYHJGZ37-7BZ7WTCI8 | 6.79 | No | View Edit Remove | |
5 | 454587 | KGDGHXO2N-BXFUMO1ZK-880OXX3BI | 6.79 | No | View Edit Remove | |
6 | 454587 | KTIAXNRSV-C53LTDMMO-8DARW3GDQ | 6.79 | No | View Edit Remove | |
7 | 454587 | LKGRDVAY7-CKTK52DDC-8O4W77PJ2 | 6.79 | No | View Edit Remove | |
8 | 454587 | LRFOZBLKF-COVWDIEGG-8QXRO2LHA | 6.79 | No | View Edit Remove | |
9 | 454587 | MKPM30U5R-D5YIYKXF4-92PFU2Q2M | 6.79 | No | View Edit Remove | |
10 | 454587 | PFQEMQEA7-EU1FGUC1C-A84CXPSV2 | 6.79 | No | View Edit Remove |