Tengo un modal que captura desde una pistola los códigos de barras, una vez capturado se generan tres listas para ello se utiliza dataTable, del contenido de la listas requiero que el contenido de una de las listas pueda ser consultado al presionar un botón por renglón o registro, ya me funciona el modal, carga la información el detalle es que en caso de que se tengan mas de dos registros en la lista, siempre me carga el contenido del ultimo registro en el modal. añado segmentos del código
1.- El código del cuerpo de la tabla: `
<table id="BienesAsignacionNuevos" class="table table-striped table-bordered" class="display" style="width:100%" >
<thead>
<tr>
<th label style="font-size:12px; background-color:#5BC0DE;">BIEN</th>
<th label style="font-size:12px; background-color:#5BC0DE;">ACTIVO</th>
<th label style="font-size:12px; background-color:#5BC0DE;">ACCIÓN</th>
</tr>
</thead>`
Aqui se realiza el recorrido del arreglo y la impresion de los datos en la tabla:
`<tbody>
<?PHP
for($i=0; $i< $totalResultadoBienesResguardanteNuevo; $i++){
$Activo=$resultadoBienesResguardanteNuevo[$i]->getEnteroActivo_Fijo();
?>
<tr>
<td style="font-size:10px;"><?= $i+1?></td>
<td style="font-size:10px;"><?=$Activo?></td>
<td style="font-size:10px;">
<button type="button" class="btn btn-info" id="AsignarActivo" name="AsignarActivo" value="<?=$Etiqueta?>" data-toggle="modal" data-target="#modalAsignarResguardo" data-keyboard="false"
data_backdrop="static" title="ASIGNACION DEL ACTIVO">
<span class="glyphicon glyphicon-screenshot"></span>
</button>
</td>
</tbody>`
El botón se el añadió el valor de la etiqueta leída por el escanear, aun así no carga los datos requeridos en el modal, se que algo me falta pero no recuerdo como hacerlo.
Este es el segmento de código del modal :
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="modalResguardosLabel"><strong><p class="text-center">REASIGNACIÓN DE RESGUARDO DE ACTIVOS:</p></strong></h4>
</div>
<div class="modal-body">
<div class="form-group">
<h5 class="modal-title"><p class="text-center">DATOS DEL RESGUARDANTE</p></h5>
<div>
<table id="BienesAsignarResguardante" class="table table-striped table-bordered" class="display" style="width:100%">
<thead>
<tr>
<th label style="font-size:8px; background-color: #5BC0DE;">NOMBRE</th>
<th label style="font-size:8px; background-color: #5BC0DE;">NUMERO EMPLEADO</th>
</tr>
</thead>
<tbody>
<tr>
<td style="font-size:10px;"><?=$Nombre?></td>
<td style="font-size:10px;"><?=$Numero_Empleado?></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-group">
<h5 class="modal-title"><p class="text-center">DATOS DEL ACTIVO</p></h5>
</div>
<div>
<table id="BienesAsignarActivo" class="table table-striped table-bordered" class="display" style="width:100%">
<thead>
<tr>
<th label style="font-size:8px; background-color: #5BC0DE;">ACTIVO</th>
<th label style="font-size:8px; background-color: #5BC0DE;">SUB ACTIVO</th>
<th label style="font-size:8px; background-color: #5BC0DE;">ETIQUETA</th>
<th label style="font-size:8px; background-color: #5BC0DE;">TIPO ACTIVO</th>
<th label style="font-size:8px; background-color: #5BC0DE;">DESCRIPCION</th>
<th label style="font-size:8px; background-color: #5BC0DE;">MARCA</th>
<th label style="font-size:8px; background-color: #5BC0DE;">MODELO</th>
<th label style="font-size:8px; background-color: #5BC0DE;">MATERIAL</th>
<th label style="font-size:8px; background-color: #5BC0DE;">COLOR</th>
<th label style="font-size:8px; background-color: #5BC0DE;">NUMERO SERIE</th>
</tr>
</thead>
<tbody>
<tr>
<td style="font-size:10px;"><?=$Activo?></td>
<td style="font-size:10px;"><?=$Subactivo?></td>
<td style="font-size:10px;"><?=$Etiqueta?></td>
<td style="font-size:10px;"><?=$Tipo_Activo?></td>
<td style="font-size:10px;"><?=$Descripcion?></td>
<td style="font-size:10px;"><?=$Marca?></td>
<td style="font-size:10px;"><?=$Modelo?></td>
<td style="font-size:10px;"><?=$Material?></td>
<td style="font-size:10px;"><?=$Color?></td>
<td style="font-size:10px;"><?=$Serie?></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" id="btnCerrarModal">Cerrar</button>
<button type="submit" name="btnActualizar" class="btn btn-primary" id="btnActualizar">Actualizar</button>
</div>
Saludos y Gracias.