pivottable.js 就像一个魅力,但不是在最基本的流星项目中。有html:
<body>
<div id="output"></div>
</body>
js(出勤变量已定义,并且在非流星项目中一切正常):
$('#output').pivot(attendance,
{
rows: ["group", "trainer", "client"],
cols: ["came"]
}
);
在 Meteor 项目中,pivot.js 应按原样放置在 client/compatibility 文件夹中,并且加载顺序正确:jquery > pivot.js > my js code。得到错误:
pivot.js:949
Uncaught TypeError: Cannot read property 'hasChildNodes' of undefined
$.fn.pivot @ pivot.js:949
(anonymous function) @ sandbox.js:20
(anonymous function) @ sandbox.js?64df4e0c48aa567cada8bd4c28bd682ed2d9ab36:41