Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/02/2010, 04:55
petete2007
 
Fecha de Ingreso: marzo-2008
Mensajes: 17
Antigüedad: 16 años, 1 mes
Puntos: 0
Respuesta: datatable llamada por parametro

Os pongo el codigo fuente por si alguien me puede ayudar.
Quiero que al pulsar sobre el enlace que tengo vuelva a llamar al datatable y cargue unos valores distintos, es decir una llamada a SAjaxSource distinta.

Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico" />
		
		<title>Panel de administraci&oacute;n</title>
		<style type="text/css" title="currentStyle">
			@import "./media/css/demo_page.css";
			@import "./media/css/demo_table.css";
		</style>
				        <link href="jquery.tab.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" language="javascript" src="./media/js/jquery.js"></script>
		<script type="text/javascript" language="javascript" src="./media/js/jquery.dataTables1.js"></script>
		<script type="text/javascript" charset="utf-8">
			var oTable;
			var x=5;
					
			
			$(document).ready(function() {
				
				//var ireference = document.getElementById('reference1').value;
				//$("#form_tabvinculos").hide();  // ocultar por defecto las pestañas
				$("#form_mostrarcomentario").hide();  // ocultar por defecto el formulario de comentario al administrador						
						
				oTable = $('#example').dataTable( {
					//"sDom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>',
					/* "bInfo": false, */    /* texto de mostrando nºencontrados */
					"bFilter": false,         /* ocultar buscador */
					"sSearch":false,
					"iDisplayLength": 1,
					"iDisplayStart": 0,
					"aoColumns": [ 
						{ "bVisible": false, "asSorting": [ "asc" ] },  
						{ "sWidth": "50%", "bSortable": false , "bSearchable": false},   /* foto */
						{ "sWidth": "50%", "bSortable": false , "bSearchable": false},  /* detalle */
						{ "bVisible": false},
						{ "bVisible": false},
						{ "bVisible": false}
						],					
					"bProcessing": true,
					/*"sPaginationType": "full_numbers",  */
					/* "bServerSide": true,  */
					"sAjaxSource": "./server_catalog.php"
				} );


	$('#boton1').click( function () {
	    var oSettings = oTable.fnSettings();
		alert(x);
 	oTable.fnClearTable();
	oTable.sAjaxSource="./server_catalog.php";
	return false;
	} );



});
		
			
		</script>
	</head>
	<body id="dt_example1">

<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="example">
	<tbody>
		<tr>
			<td colspan="6" class="dataTables_empty">Cargando datos del servidor...</td>
		</tr>
	</tbody>
</table>


<a href="#" id="boton1"> boton1</a>
	</body>
</html>