<%@include file="/jsp/common/defaultTopLogin.jsp"%>

<script>

	$(document).ready(
		function() {
			realizaConsulta();
			$("table thead tr").addClass("encabezado");
			
			   $('#filtro').on( 'keyup click', function () {
			        filterGlobal();
			    } );
		}
	);

	function realizaConsulta(){
		
	    var oTable=null
	     oTable=$('#cataMaterial').dataTable({
		   "bAutoWidth": false,
			"oLanguage":{	"sProcessing":     "Procesando...",
							"sLengthMenu":     "Mostrar _MENU_ registros",
							"sZeroRecords":    "Sin eventos encontrados",
							"sEmptyTable":     "Sin eventos encontrados",
							"sInfo":           "Mostrando  _START_ al _END_ de  _TOTAL_ ",
							"sInfoEmpty":      "0 registros",
							"sInfoFiltered":   "(filtrado de un total de _MAX_ registros)",
							"sSearch":         "Buscar:",
							"sInfoThousands":  ",",
							"sLoadingRecords": "Cargando...",
							"oPaginate": {
								"sFirst":    "Primero",
					        	"sLast":     "&Uacute;ltimo",
					        	"sNext":     "Siguiente",
					        	"sPrevious": "Anterior"
					    	}
					},
			"iDisplayLength": 10,
			"bInfo": true,
			"bFilter": true,			
			"bSort": false,
			"bPaginate":true,
		
			"sPaginationType" : "full_numbers",
			"aaSorting": [],
				"sAjaxSource": "indexlistadoMateriales",
				"sAjaxDataProp":"", 
		       	"aoColumns": [
							{"sTitle":"C&oacute;digo SAP","mDataProp":"codigoSap","bSearchable": true, sWidth : "900px"},
		          			{"sTitle":"Descripción Material","mDataProp":"descripcionMaterial","bSearchable": true, sWidth : "600px"},
							{"sTitle":"Unidad de Medida","mDataProp":"unidadMedida","bSearchable": true, sWidth : "400px"},
							{"sTitle":"Código Iso Medida","mDataProp":"codigoIsoMedida","bSearchable": true, sWidth : "400px"},
							{"sTitle":"Material Antiguo","mDataProp":"materialAntiguo","bSearchable": true, sWidth : "400px"}
		          			]
			});
	}
	
	

</script>
	
	<table id="cataMaterial" class="table table-striped">
				
	</table>
	
<%@include file="/jsp/common/defaultBottomLogin.jsp"%>
