junto con saludar, resulta que tengo un problema, tengo un boton el cual llamo a una ventana modal mediante un parametro (serieDesplegar) que se compara a una fila de la misma tabla (rme_codigo), pero solo me toma el primer valor de la fila y me los repite hacia abajo, hay posibilidad de poder abrir una ventana modal por cada valor de cada fila? adjunto mi codigo y unas fotos.
<div class="card mb-3">
<div class="card-header">
<i class="fas fa-table"></i>
Listado DATACARD
</div>
<div>
@using (Html.BeginForm("Tablas", "Dashboard", FormMethod.Get))
{
<p>
<div style="text-align:initial;" />
Busqueda por codigo: @Html.TextBox("rme_codigo")
<input type="submit" value="Filtro de busqueda" button class="btn btn-secondary btn-sm" />
</p>
}
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered" style="table-layout:fixed" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>CODIGO</th>
<th>DESCRIPCION</th>
<th>DETALLE EMBOSADORA</th>
<th>LOG MAQUINA</th>
<th>VIGENCIA</th>
</tr>
</thead>
<tfoot>
<tr>
<th>CODIGO</th>
<th>DESCRIPCION</th>
<th>DETALLE EMBOSADORA</th>
<th>LOG MAQUINA</th>
<th>VIGENCIA</th>
</tr>
</tfoot>
<tbody>
<tr>
@foreach (var item in Model)
{
var color = "#fff";
if (item.rme_vigente == false)
{
color = "#DC3546";
}
else if (item.rme_vigente == true)
{
color = "#27A844";
}
<tr>
<td style="width: 1%; text-align: left;">
@item.rme_codigo
</td>
<td style="width: 1%; text-align: left;">
@item.rme_descripcion
</td>
<td style="width: 1%; text-align: center;">
<button type="button" class="btn-info" style="width:100px; text-align: center">Detalles</button>
<div class="modal fade" id="myModal" role="dialog" data-url="@Url.Action("partialViewPrueba", "Date", new { serieDesplegar = item.rme_codigo })">
</div>
</td>
<td style="width: 1%; text-align: center;">
@Html.ActionLink("Descargar log", "TraerLog", "Dashboard", new { @class = "btn" })
</td>
<td style="width: 1%; text-align: center;">
@Html.Action("verStatuss", "Dashboard", new { serieDesplegar = item.rme_codigo})
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="card-footer small text-muted">Updated yesterday at 11:59 PM</div>
</div>
Desde mi controlador llamo a la clase que obtengo los datos:
public ActionResult partialViewPrueba(string serieDesplegar)//get
{
string[] holiweb = new string[6];
holiweb = logica.desplegarTabla(serieDesplegar);
ViewBag.viubag1 = holiweb;
return PartialView(logica.desplegarTabla(serieDesplegar));
}
[HttpPost]
public ActionResult partialViewPrueba(Embozadora embo)//post
{
return View();
}
Por ejemplo le di click al detalle de la fila donde esta el codigo (DatacardSD260M1), pero siempre me aparece el primer codigo de la fila( EvolisPrimacy4), no me muestra ninguno mas
Ventana modal:
@if (ViewBag.viubag1 != null)
{
<div class="modal-body">
<table class="table">
<tr>
<td>N° Serie</td>
<td>Sucursal</td>
<td>Status</td>
<td>Cantidad Incidencias</td>
<td>Fecha Activa</td>
<td>Tarjeta</td>
</tr>
<tr>
<td>
@ViewBag.viubag1[0]
</td>
<td>
@ViewBag.viubag1[1]
</td>
<td>
@ViewBag.viubag1[2]
</td>
<td>
@ViewBag.viubag1[3]
</td>
<td>
@ViewBag.viubag1[4]
</td>
<td>
@ViewBag.viubag1[5]
</td>
</tr>
</table>
</div>}
Lo que deseo es dar clic en detalles y muestre un modal con los detalles de la embosadora seleccionada, espero se entienda, quedo antento a una ayuda!