我有一个包含以下列的 Infragistics 网格:-
@(Html.Infragistics().Grid(Model.Rows.AsQueryable())
.ID("vmClientBankAccounts")
.Width("100%")
.Caption("Bank Account List")
.PrimaryKey("AccountNo")
.AutoGenerateColumns(false)
.RowTemplate("<td>${Id}</td><td><a class='accountKey'>${AccountNo}</a></td><td>${Name}</td><td>${AccountType}</td><td>${Status}</td><td>${BranchName}</td><td>${BranchIBT}</td>")
.Columns(columns =>
{
columns.For(x => x.Id).DataType("string").Hidden(true);
columns.For(x => x.AccountNo).DataType("int").Width("140px");
columns.For(x => x.Name).DataType("string");
columns.For(x => x.AccountType).DataType("string").Width("100px");
columns.For(x => x.Status).DataType("string").Width("110px");
columns.For(x => x.BranchName).DataType("string").Width("260px");
columns.For(x => x.BranchIBT).DataType("string").Width("110px");
})
.Features(features =>
{
features.Paging().PageSize(10).PrevPageLabelText("Previous").NextPageLabelText("Next");
features.Selection().Mode(SelectionMode.Row).MultipleSelection(false);
})
.DataBind()
.Render()
)
我有 javascript 在单击网格中的选定行时运行,如下所示:-
<script type="text/javascript">
$(document).ready(function () {
$('#vmClientBankAccounts td .accountKey').click(function (e) {
$.ajax({
type: 'GET',
url: '/Client/ClientBankAccount',
data: { bankAccountNo: $(e.target).text() },
success: function (result) { $('#clientContainer').html(result); }
});
});
});
我需要获取名为“Id”的第一列的单元格值,该列是隐藏列。
使用以下 igGrid 方法,我可以获得任何显示的值,但不知道如何获得隐藏列的值。
var rowIndex = $("#vmClientBankAccounts").igGrid("selectedRow").IdCellValue;
var IdCellValue = $($("#vmClientBankAccounts").igGrid("cellAt", 0, rowIndex)).text();
我将不胜感激在这方面的任何帮助,并提前感谢您。