我正在和这张桌子搏斗。数据以似乎正确的格式返回到页面,但除了灰色条之外什么都没有显示。
这是我的桌子
<table id="contactHistoryList"
data-toggle="table"
data-url="/api/members/@ViewBag.MemberID/contact-history">
<thead>
<tr>
<td data-field="id">@Html.DisplayNameFor(m => m.ID)</td>
<td data-field="contactedOn">@Html.DisplayNameFor(m => m.ContactedOn)</td>
<td data-field="method">@Html.DisplayNameFor(m => m.Method)</td>
<td data-field="reason">@Html.DisplayNameFor(m => m.Reason)</td>
<td data-field="direction">@Html.DisplayNameFor(m => m.Direction)</td>
<td data-field="outcome">@Html.DisplayNameFor(m => m.Outcome)</td>
<td data-field="notes">@Html.DisplayNameFor(m => m.Notes)</td>
</tr>
</thead>
url 发送到我的 api 控制器
[Route("{memberId:int:min(1)}/contact-history")]
public async Task<IHttpActionResult> GetContactHistory(int memberId)
{
try
{
IEnumerable<MemberContactView> contactHistory = await _memberContactRepository.GetByMemberIdAsViewAsync(memberId);
var results = contactHistory
.OrderByDescending(ch => ch.CreatedOn)
.Select(ch => new MemberContactHistoryItem
{
ID = ch.ID,
ContactedOn = ch.ContactedOn,
Method = ch.ContactMethod,
Reason = ch.ContactReason,
Direction = ch.InboundContact,
Outcome = ch.ContactDisposition,
Notes = ch.Notes
});
//_logger.Debug("Returning OK (200).");
return Ok(results);
}
catch (Exception ex)
{
// _logger.Error("Returning Internal Server Error (500).", ex);
return InternalServerError(ex);
}
}
结果返回页面://localhost:52317/api/members/67636/contact-history?order=asc
0: {id: 35167, contactedOn: "2015-04-17T18:40:00", method: "Home Phone", reason: "Confirmation",…}
[
{
"id": 35167,
"contactedOn": "2015-04-17T18:40:00",
"method": "Home Phone",
"reason": "Confirmation",
"direction": false,
"outcome": "Left Voice Message",
"notes": "Left VM."
}
]
页面加载,我看到的只是一个灰色条:localhost:52317/CallCenter/Campaigns/14/Solicit/67636
为什么页面没有加载任何数据?