DEMO SITE v1.7.15

Bulk Delete Bootstrap 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 IdCd KeySumActivated 
1113018A70YVCRZ6-68YH9YCJC-YZPMYXLK2.15No
2113018AXCZBV136-6P3J9AKE0-11I3EW2DK2.15No
3113018J48ZOEVB6-BPUAEX83C-1TM7R2NXK2.15No
4113018J4YZHBSN6-BQA7ZHZNC-1TOOYXZ9K2.15No
5113018JV9Y4NZOI-C6EMSJWXK-1W6Z53AUW2.15No
6113018KBE3JZKCI-CGA7V8TDK-1XQAC6QIW2.15No
7113018M3N7W0AD3-DJNZ2DF8Y-L2K6GEKOT2.15No
8113018MFPN46A4I-DR28N8R08-2508H3IYW2.15No
9113018NMHK02MLU-EHA2YUJ14-2931RXZ682.15No
10113018O4Z1IBDSI-ESLYZ9S48-2AUHV214W2.15No
Search