0

我正在使用斜倚 JS,并完成了教程中提到的所有操作,但是我不断收到此错误:

Uncaught Error: SlickGrid's 'enableColumnReorder = true' option
requires jquery-ui.sortable module to be loaded

到目前为止我做了什么:

<link href="css/bootstrap/bootstrap.css" rel="stylesheet">
<link href="css/recline/slickgrid.css" rel="stylesheet">
<link href="css/recline/grid.css" rel="stylesheet">
<link href="css/recline/recline.css" rel="stylesheet">

<script type="text/javascript" src="js/core/slickgrid/jquery-1.7.min.js"></script>
<script type="text/javascript" src="js/core/slickgrid/jquery.event.drag-2.0.min.js"></script>

<script type="text/javascript" src="js/core/underscore/underscore-1.3.3.js"></script>
<script type="text/javascript" src="js/core/backbone/backbone-0.9.2.js"></script>

<script type="text/javascript" src="js/core/slickgrid/slick.core.js"></script>
<script type="text/javascript" src="js/core/slickgrid/slick.grid.js"></script>
<!-- Recline -->
<script type="text/javascript" src="js/core/recline/recline.js"></script>
<script type="text/javascript" src="js/core/recline/recline.dataset.js"></script>
<script type="text/javascript" src="js/core/recline/view.grid.js"></script>

我用来初始化网格的代码是

var data = [
{id: 0, date: '2011-01-01', x: 1, y: 2, z: 3, country: 'DE', geo: {lat:52.56, lon:13.40} },
{id: 1, date: '2011-02-02', x: 2, y: 4, z: 24, country: 'UK', geo: {lat:54.97, lon:-1.60}},
{id: 2, date: '2011-03-03', x: 3, y: 6, z: 9, country: 'US', geo: {lat:40.00, lon:-75.5}},
{id: 3, date: '2011-04-04', x: 4, y: 8, z: 6, country: 'UK', geo: {lat:57.27, lon:-6.20}},
{id: 4, date: '2011-05-04', x: 5, y: 10, z: 15, country: 'UK', geo: {lat:51.58, lon:0}},
{id: 5, date: '2011-06-02', x: 6, y: 12, z: 18, country: 'DE', geo: {lat:51.04, lon:7.9}}
];
var dataset = new recline.Model.Dataset({
records: data
});
console.log(dataset);
var $el = $('#mygrid');
var grid = new recline.View.SlickGrid({
model: dataset,
el: $el
});
grid.visible = true;
grid.render();

有什么我想念的吗?

4

1 回答 1

1

转到您已下载的 SlickGrid 文件夹。您会在其中找到一个“lib”文件夹。这个“lib”文件夹包含“jquery-ui-1.8.16.custom.min.js”。它的版本可能会根据您的 SlickGrid 版本而有所不同。如果您将来遇到类似的困难,请确保检查所有文件夹以获取所需的 .js 文件。祝你好运!!

于 2013-08-05T12:41:04.680 回答