	function loadData() {
	var oTable = $('#purchase-order').DataTable( {
	"serverSide": true,
	  "ajax": {
		"url": "/purchase-order/list",
		"type": "POST",
	  },
	"columnDefs": [
    { className: "dt-body-center", "targets": [ 0,1,2,3,4,5,6,7 ] },
    
  ],
	"language": {
                "aria": {
                    "sortAscending": ": activate to sort column ascending",
                    "sortDescending": ": activate to sort column descending"
                },
                "emptyTable": "No data available in table",
                "info": "Showing _START_ to _END_ of _TOTAL_ entries",
                "infoEmpty": "No entries found",
                "infoFiltered": "(filtered1 from _MAX_ total entries)",
                "lengthMenu": "_MENU_ entries",
                "search": "Search:",
                "zeroRecords": "No matching records found"
            },
	buttons: [
		{ extend: 'print', className: 'btn dark btn-outline' },
		{ extend: 'excel', className: 'btn yellow btn-outline ' },
		{ extend: 'colvis', className: 'btn dark btn-outline', text: 'Columns'}
	],
	"lengthMenu": [ [10, 25, 50,100,99999999], [10, 25, 50,100, "All"] ],
	"order": [
		[ 0, 'asc' ]
	],
	
	});
	
	var tableWrapper = jQuery('#purchase-order_wrapper');
	$('.search-input-text').on( 'keyup click change', function () {
		var i =$(this).attr('data-column');
		var v =$(this).val();
		oTable.columns(i).search(v).draw();
	} );
	$('.search-input-select').on( 'change', function () {
		var i =$(this).attr('data-column');  
		var v =$(this).val();  
		oTable.columns(i).search(v).draw();
	} );
	$('.filter-cancel').on( 'click', function () {
		$('.search-input-text').val('');
		$('.search-input-select').val('');
		$('.search-input-text').trigger('change');
		$('.search-input-select').trigger('change');
		
		oTable.draw();
	} );
	$("#purchase-order_filter").css("display","none"); 
	$('#sample_3_tools > li > a.tool-action').on('click', function() {
		var action = $(this).attr('data-action');
		oTable.DataTable().button(action).trigger();
	});
	

}
$(document).ready(function() {
    loadData(1);	
});