I have a table with following columns: checkbox, text, text, ... For every selected checkbox I need to get the 2nd text value and test if contains some value.
My code so far
$('input:checkbox').each(function () {
var current = $(this);
if (current.is(':checked')) {
var txt = current.next('.inf-name').text();
if (txt.contains(inf) { ... }
}
});
razor code:
<table class="table table-bordered table-modified">
<thead>
<tr>
<th></th>
<th>State</th>
<th>Lookup Type</th>
<th>Plates</th>
<th>Notices</th>
</tr>
</thead>
<tbody>
@Html.HiddenFor(p => p.OrgUnitID, new { @Value = orgUnitId })
@for(var ind = 0; ind < records.Count(); ++ind)
{
var r = records[ind];
var i = ind;
@Html.HiddenFor(p => p.Comp[i].State, new { @Value = @r.State })
<tr>
<td>@Html.CheckBoxFor(p => p.Comp[i].Checked)</td>
<td>@r.State</td>
@if (dict.ContainsKey(r.State))
{ <td class="inf-name">@dict[r.State].ToString()</td> }
else
{ <td class="inf-name"></td> }
<td>@Html.ActionLink(@r.Plates.ToString(CultureInfo.InvariantCulture), "Plates", new { controller = "Lookup", state = @r.State})</td>
<td>@Html.ActionLink(@r.Notices.ToString(CultureInfo.InvariantCulture), "Plates", new { controller = "Lookup" }, new { state = @r.State })</td>
</tr>
}
</tbody>
</table>
where inf-name is the class on 2nd element. I can't get it done. Anyone know a solution?
Aucun commentaire:
Enregistrer un commentaire