wenzhixin bootstrap table 确实加载了传递给页面的任何数据
wenzhixin bootstrap table does load any of the data that's passed to the page
我正在努力解决这个问题 table。数据以似乎正确的格式return输入页面,但除了一个灰色条之外没有显示任何内容。
这是我的table
<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);
}
}
结果return到页面://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
为什么页面没有加载任何数据?
table的headers我有<td>
。他们应该是 <th>
.
我正在努力解决这个问题 table。数据以似乎正确的格式return输入页面,但除了一个灰色条之外没有显示任何内容。
这是我的table
<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);
}
}
结果return到页面://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
为什么页面没有加载任何数据?
table的headers我有<td>
。他们应该是 <th>
.