我有一個Infragistics的網格有以下的列的單元格的值: -獲取隱藏igGrid列
@(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); }
});
});
});
我需要得到我的名爲「身份證」,這是一個隱藏列第一列的單元格值。
使用以下方法igGrid我能夠獲得任何所顯示的數值,但不知道如何獲取隱藏的列值。
var rowIndex = $("#vmClientBankAccounts").igGrid("selectedRow").IdCellValue;
var IdCellValue = $($("#vmClientBankAccounts").igGrid("cellAt", 0, rowIndex)).text();
我希望在這方面提供任何幫助,並提前致謝。