我想在我的JQuery數據表顯示鏈接中的一列如下面的代碼所示,但我總是得到一個錯誤,沒有顯示任何東西。有人可以通過指出我在做什麼錯誤以及如何正確地將數據表列中顯示的數據更改爲鏈接來幫助嗎?由於JQuery Datatables在表列之一顯示鏈接
<div class="table-responsive">
<table ui-jq="dataTable" ui-options="{
data: dset,
aoColumns: [
{ mData: 'title' },
{ mData: 'firstName' },
{ mData: 'lastName' },
{ mData: 'email' }
],
"aoColumnDefs": [ {
"aTargets": [ 3 ],
"mRender": function (data, type, full) {
return '<a href="/mailto/' + full[3] + '">' + data + '</a>';
}
}
]
}" class="table table-striped m-b-none">
<thead>
<tr>
<th style="width:15%">Title</th>
<th style="width:30%">First Name</th>
<th style="width:30%">Last Name</th>
<th style="width:25%">Email</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
注:DSET回報:
[{"_id":"543e58b862744980197026a8","title":"Mr.","firstName":"Michael","lastName":"A","email":"[email protected]","address":"New York","password":"123456","activeMember":true,"__v":0,"role":"Member","memberSince":"2014-10-15T11:21:28.884Z"},{"_id":"543e591862744980197026a9","title":"Ms","firstName":"Mary","lastName":"W","email":"[email protected]","address":"New York","password":"123456","activeMember":true,"__v":0,"role":"Admin","memberSince":"2014-10-15T11:23:04.382Z"}]
- 另外我在執行上表中我AngularJS應用程序。
錯誤,我看到的是:
Error: [$parse:syntax] Syntax Error: Token 'undefined' is unexpected, expecting [:] at column null of the expression [[{
data: dset,
aoColumns: [
{ mData: 'title' },
{ mData: 'firstName' },
{ mData: 'lastName' },
{ mData: 'email' }
],]] starting at [[{
data: dset,
aoColumns: [
{ mData: 'title' },
{ mData: 'firstName' },
{ mData: 'lastName' },
{ mData: 'email' }
],]].