【发布时间】:2016-06-15 06:06:20
【问题描述】:
我无法在模式对话框中显示数据表。我得到一张空桌子。
//创建进入模态的数据表
createTableForModal(selectedLesson);
//show the modal
$('#editLessonModal').modal();
createTableForModal 的代码
function createTableForModal()
{
//this is just example code, but it doesn't work
var dataSet = [
[ "Tiger Nixon", "System Architect", "Edinburgh", "5421", "2011/04/25", "$320,800" ],
[ "Garrett Winters", "Accountant", "Tokyo", "8422", "2011/07/25", "$170,750" ]];
$(document).ready(function() {
$('#uploadVideosTable').DataTable( {
data: dataSet,
columns: [
{ title: "Name" },
{ title: "Position" },
{ title: "Office" },
{ title: "Extn." },
{ title: "Start date" },
{ title: "Salary" }
],retrieve: true,
} );
} );
}
数据表的 HTML
<table id="uploadVideosTable" class="table table-striped table-bordered table-hover table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start Date</th>
<th>Salary</th>
</tr>
</thead>
</table>
【问题讨论】:
-
任何控制台错误??
-
不,没有任何控制台错误。
标签: jquery twitter-bootstrap datatables bootstrap-modal