私はこのテーブルと格闘しています。データは正しいと思われる形式でページに返されますが、灰色のバー以外には何も表示されません。
これは私のテーブルです
<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
ページがデータをロードしないのはなぜですか?