我正在尝试使用ckanext_reclineview
来呈现 CSV 数据。我正在使用ckan2.5.2
在 Windows 7 上运行。
加载查看器时遇到以下 JS 错误:
Uncaught ReferenceError: Backbone is not defined
(anonymous function) @ widget.recordcount.js:9
(anonymous function) @ widget.recordcount.js:29
Uncaught TypeError: Cannot read property 'each' of undefined
(anonymous function) @ backbone.js:216
(anonymous function) @ backbone.js:1571
Uncaught TypeError: Cannot read property 'isUndefined' of undefined
(anonymous function) @ ckan.js:214
(anonymous function) @ ckan.js:254
Uncaught TypeError: Cannot read property 'extend' of undefined
(anonymous function) @ recline.js:399
(anonymous function) @ recline.js:1037
Uncaught TypeError: recline.Model.Dataset is not a constructor
loadView @ recline_view.js:59
_onReady @ recline_view.js:27
proxy @ jquery.js:827
fire @ jquery.js:3048
self.add @ jquery.js:3094
jQuery.fn.jQuery.ready @ jquery.js:271
initialize @ recline_view.js:18
module.createInstance @ module.js:320
(anonymous function) @ module.js:289
jQuery.extend.each @ jquery.js:657
module.initializeElement @ module.js:285
(anonymous function) @ module.js:262
jQuery.extend.each @ jquery.js:657
jQuery.fn.jQuery.each @ jquery.js:266
module.initialize @ module.js:261
(anonymous function) @ main.js:47
fire @ jquery.js:3048
self.fireWith @ jquery.js:3160
(anonymous function) @ jquery.js:3211
fire @ jquery.js:3048
self.fireWith @ jquery.js:3160
done @ jquery.js:8235
callback @ jquery.js:8778
我发现 Javascript 加载的顺序没有按预期工作。
与其他资源不同,所有recline_view
JS 文件都是根据 JS 文件名顺序加载的。backbone.js
依赖于underscore.js
,但underscore.js
在之后加载backbone.js
有关生成的 HTML,请参见下文:
<script type="text/javascript" src="/fanstatic/vendor/:version:2016-06-03T12:33:21.23/jquery.js"></script>
<script type="text/javascript" src="/fanstatic/vendor/:version:2016-06-03T12:33:21.23/jed.js"></script>
<script type="text/javascript" src="/fanstatic/vendor/:version:2016-06-03T12:33:21.23/moment-with-locales.js"></script>
<script type="text/javascript" src="/fanstatic/vendor/:version:2016-06-03T12:33:21.23/select2/select2.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/sandbox.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/module.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/pubsub.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/client.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/notify.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/i18n.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/main.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.date-helpers.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.form-warning.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.inherit.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.masonry.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.proxy-all.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.slug-preview.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.slug.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.truncator.js"></script>
<script type="text/javascript" src="/fanstatic/base/:version:2016-06-06T15:49:43.51/plugins/jquery.url-helpers.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/widget.recordcount.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/recline_view.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/backbone/1.0.0/backbone.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/bootstrap/2.3.2/bootstrap.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/ckan.js/ckan.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/flot/excanvas.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/flot/jquery.flot.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/flot/jquery.flot.time.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/jquery/1.7.1/jquery.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/json/json2.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/leaflet/0.7.3/leaflet.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/leaflet.markercluster/leaflet.markercluster.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/moment/2.0.0/moment.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/mustache/0.5.0-dev/mustache.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/recline/recline.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/slickgrid/2.0.1/jquery-ui-1.8.16.custom.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/slickgrid/2.0.1/jquery.event.drag-2.0.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/slickgrid/2.0.1/slick.grid.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/slickgrid/2.0.1/plugins/slick.rowmovemanager.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/slickgrid/2.0.1/plugins/slick.rowselectionmodel.js"></script>
<script type="text/javascript" src="/fanstatic/ckanext-reclineview/:version:2016-06-08T15:44:54.11/vendor/underscore/1.4.4/underscore.js"></script></body>
这是我的resource.config
文件:
[main]
force_top = vendor/underscore/1.4.4/underscore.js
order = vendor/underscore/1.4.4/underscore.js vendor/backbone/1.0.0/backbone.js
[IE conditional]
lte IE 7 =
vendor/json/json2.js
lte IE 8 =
vendor/flot/excanvas.js
[custom render order]
vendor/underscore/1.4.4/underscore.js = 18
vendor/backbone/1.0.0/backbone.js = 19
[depends]
main = base/main
[groups]
main =
vendor/jquery/1.7.1/jquery.js
vendor/underscore/1.4.4/underscore.js
vendor/backbone/1.0.0/backbone.js
vendor/mustache/0.5.0-dev/mustache.js
vendor/bootstrap/2.3.2/bootstrap.js
vendor/json/json2.js
vendor/flot/excanvas.js
vendor/flot/jquery.flot.js
vendor/flot/jquery.flot.time.js
vendor/leaflet/0.7.3/leaflet.js
vendor/leaflet.markercluster/leaflet.markercluster.js
vendor/slickgrid/2.0.1/jquery-ui-1.8.16.custom.js
vendor/slickgrid/2.0.1/jquery.event.drag-2.0.js
vendor/slickgrid/2.0.1/slick.grid.js
vendor/slickgrid/2.0.1/plugins/slick.rowselectionmodel.js
vendor/slickgrid/2.0.1/plugins/slick.rowmovemanager.js
vendor/moment/2.0.0/moment.js
vendor/ckan.js/ckan.js
vendor/recline/recline.js
widget.recordcount.js
recline_view.js
vendor/bootstrap/2.3.2/css/bootstrap.css
vendor/leaflet/0.7.3/leaflet.css
vendor/leaflet.markercluster/MarkerCluster.css
vendor/leaflet.markercluster/MarkerCluster.Default.css
vendor/slickgrid/2.0.1/slick.grid.css
vendor/recline/recline.css
css/recline.css
任何帮助将不胜感激
谢谢