recibir en pagina php, la fila seleccionada en una tabla dataTable jquery

Páginas: (1/2) > >>

ismaelviamontes:

ya logro mostrar mis datos en una dataTable, y logro seleccionar una fila, ahora quiero recibir los valores de esa fila en una pagina php, para poder procesar dichos datos, como puedo hacer eso, aca les pongo el codigo para mostrar el dato y seleccionar la fila...., alguna ayuda please.

Código
--
var oTable;
--
var giRedraw = false;
--
$(document).ready(function() {
--
oTable=$('#example').dataTable( {"bProcessing": true, "sPaginationType": "full_numbers",
--
"sAjaxSource": "pag_aux/dataTable/BAbiertas.ivm"} );
--
 
--
 
--
/* Add a click handler to the rows - this could be used as a callback */
--
$("#example tbody").click(function(event) {
--
$(oTable.fnSettings().aoData).each(function (){
--
$(this.nTr).removeClass('row_selected');
--
});
--
$(event.target.parentNode).addClass('row_selected' ); });
--
 
--
/*Submit*/
--
$('#TablaForm').submit( function() {
--
var anSelected = fnGetSelected( oTable );
--
alert(anSelected[0]);
--
return false;} ); } );
--
 
--
/* Get the rows which are currently selected */
--
function fnGetSelected( oTableLocal )
--
{
--
var aReturn = new Array();
--
var aTrs = oTableLocal.fnGetNodes();
--
 
--
for ( var i=0 ; i<aTrs.length ; i++ )
--
{
--
if ( $(aTrs).hasClass('row_selected') )
--
{
--
aReturn.push( aTrs );
--
}
--
}
--
return aReturn;
--
}
--



Código
--
<form id="TablaForm" action="" name="TablaForm" >
--
<table class="display" id="example">
--
<thead>
--
<tr>
--
<th width="39" height="51" >ID</th>
--
<th width="101" >Controlador</th>
--
<th width="95" >Reportada </th>
--
<th width="133" >Ubicaci&oacute;n</th>
--
<th width="104" >Radar</th>
--
<th width="86" >Fecha Apertura </th> </tr>
--
</thead>
--
<tbody>
--
<tr>
--
<td height="28" colspan="9" class="dataTables_empty">Cargando datos del servidor... </td>
--
 
--
</tr>
--
</tbody>
--
</table>
--
<div style="clear: both;"> </div>
--
<div style="text-align:right; padding-bottom:1em;">
--
<button type="submit" id="submit">Submit form</button>
--
</div>
--
</form>
--


Nakp:

envia los datos por post con jquery ;) (puede ser json)


ismaelviamontes:

hmm, y me puedes poner un ejemplo de como hacerlo ?

Nakp:

http://datatables.net/examples/data_sources/server_side.html

eduardo_caracas:

buenas tardes
hermano resolviste el problema con el datatable jquery por favor ayudame necesito que al darle doble click en abra otra pagina pasando la fila seleccionada

por fa es urgente


Cita de: ismaelviamontes en 26 Febrero 2010, 20:57 pm
--
ya logro mostrar mis datos en una dataTable, y logro seleccionar una fila, ahora quiero recibir los valores de esa fila en una pagina php, para poder procesar dichos datos, como puedo hacer eso, aca les pongo el codigo para mostrar el dato y seleccionar la fila...., alguna ayuda please.

Código
--
var oTable;
--
var giRedraw = false;
--
$(document).ready(function() {
--
oTable=$('#example').dataTable( {"bProcessing": true, "sPaginationType": "full_numbers",
--
"sAjaxSource": "pag_aux/dataTable/BAbiertas.ivm"} );
--
 
--
 
--
/* Add a click handler to the rows - this could be used as a callback */
--
$("#example tbody").click(function(event) {
--
$(oTable.fnSettings().aoData).each(function (){
--
$(this.nTr).removeClass('row_selected');
--
});
--
$(event.target.parentNode).addClass('row_selected' ); });
--
 
--
/*Submit*/
--
$('#TablaForm').submit( function() {
--
var anSelected = fnGetSelected( oTable );
--
alert(anSelected[0]);
--
return false;} ); } );
--
 
--
/* Get the rows which are currently selected */
--
function fnGetSelected( oTableLocal )
--
{
--
var aReturn = new Array();
--
var aTrs = oTableLocal.fnGetNodes();
--
 
--
for ( var i=0 ; i<aTrs.length ; i++ )
--
{
--
if ( $(aTrs).hasClass('row_selected') )
--
{
--
aReturn.push( aTrs );
--
}
--
}
--
return aReturn;
--
}
--



Código
--
<form id="TablaForm" action="" name="TablaForm" >
--
<table class="display" id="example">
--
<thead>
--
<tr>
--
<th width="39" height="51" >ID</th>
--
<th width="101" >Controlador</th>
--
<th width="95" >Reportada </th>
--
<th width="133" >Ubicaci&oacute;n</th>
--
<th width="104" >Radar</th>
--
<th width="86" >Fecha Apertura </th> </tr>
--
</thead>
--
<tbody>
--
<tr>
--
<td height="28" colspan="9" class="dataTables_empty">Cargando datos del servidor... </td>
--
 
--
</tr>
--
</tbody>
--
</table>
--
<div style="clear: both;"> </div>
--
<div style="text-align:right; padding-bottom:1em;">
--
<button type="submit" id="submit">Submit form</button>
--
</div>
--
</form>
--

--


Páginas: (1/2) > >>