在js中如何在dataTable中动态的绑定数据

<scripttype="text/javascript"language="javascript"class="init">vararr=[{name:"fxf",po... <script type="text/javascript" language="javascript" class="init">

var arr = [
{ name: "fxf", position: "China", office: "hubei", age: 23, startday: "1991 /10 /19", salary: "¥5000" },//json
{ name: "jk", position: "China", office: "hubei", age: 23, startday: "1991 /10 /19", salary: "¥5000" },
{ name: "zz", position: "China", office: "hubei", age: 21, startday: "1991 /10 /19", salary: "¥5000" },
{ name: "cl", position: "China", office: "hubei", age: 22, startday: "1991 /10 /19", salary: "¥5000" },
{ name: "fy", position: "China", office: "hubei", age: 16, startday: "1991 /10 /19", salary: "¥5000" },
{ name: "fh", position: "China", office: "hubei", age: 18, startday: "1991 /10 /19", salary: "¥5000" },
{ name: "cq", position: "China", office: "hubei", age: 23, startday: "1991 /10 /19", salary: "¥5000" },
{ name: "wq", position: "China", office: "hubei", age: 20, startday: "1991 /10 /19", salary: "¥5000" }
];
$(document).ready(function () {
$("#example").dataTable({
"bPaginate":true,
"bInfo": true,
"bPaginationType":"full_numbers",
"columns": ["name","position","office","age","startday","salary"],
"data": arr,
"order": [[1, 'asc']]
});
});
</script>
使用这段代码 数据绑定不进去
展开
 我来答
若以下回答无法解决问题,邀请你更新回答
冼慧雅3z
2014-07-11 · TA获得超过177个赞
知道小有建树答主
回答量:330
采纳率:100%
帮助的人:222万
展开全部
你仔细阅读 dataTable 这个组件的文档的api吧,估计是没有按要求的数据格式提供数据的问题。
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式