Kra*_*mer 0 javascript asp.net-web-api
我遇到了一个关于JavaScript的问题.具体来说,我有一张桌子
<table class="table">
<tr>
<th>
<label>Select</label>
</th>
<th>
@Html.DisplayNameFor(model => model.FirstName)
</th>
<th>
@Html.DisplayNameFor(model => model.Middle)
</th>
<th>
@Html.DisplayNameFor(model => model.LastName)
</th>
<th>
@Html.DisplayNameFor(model => model.DoB)
</th>
<th>
@Html.DisplayNameFor(model => model.Gender)
</th>
<th>
@Html.DisplayNameFor(model => model.StartDate)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr id="@Html.DisplayFor(modelItem => item.EmployeeId)" ondblclick="DoubleClickOnRow(this)">
<td>
<input id="@Html.DisplayFor(modelItem => item.EmployeeId)" type="checkbox" onclick="SelectCheckBox(this)"/>
</td>
<td>
@Html.DisplayFor(modelItem => item.FirstName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Middle)
</td>
<td>
@Html.DisplayFor(modelItem => item.LastName)
</td>
<td>
@Html.DisplayFor(modelItem => item.DoB)
</td>
<td>
@Html.DisplayFor(modelItem => item.Gender)
</td>
<td>
@Html.DisplayFor(modelItem => item.StartDate)
</td>
</tr>
}
</table>
Run Code Online (Sandbox Code Playgroud)
我声明了一个数组来保持EmployeeId不检查行的第一列中的复选框.但是,它表示arrayOfEmployeeId.push(id); 不是一个功能.顺便说一下,我希望在ASP.NET web api中获取EmployeeId数组来执行DELETE方法.我对吗?
var arrayOfEmployeeId = {};
function SelectCheckBox(thisRow)
{
var id = thisRow.id;
arrayOfEmployeeId.push(id);
console.log(arrayOfEmployeeId);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
77 次 |
| 最近记录: |