我尝试在mean.io项目中使用kendo gantt chart。
并且面对图表不起作用的麻烦 - TypeError: undefined is not a function
。 Gantt data source正确创建
剑道版本是2014.3.1119
Kendo javascript,css和其他资源现在包含在主html文件中,default.html
当我在带有图表定义的html文件中移动kendo包含时,bug就会消失。 甘特图创建数据源并正确工作,除了本地化
html包括:
<!-- including css -->
<link rel='stylesheet' href='kendo/styles/kendo.common.min.css' />
<link rel='stylesheet' href='kendo/styles/kendo.default.min.css' />
<link rel='stylesheet' href='kendo/styles/kendo.dataviz.min.css' />
<link rel='stylesheet' href='kendo/styles/kendo.dataviz.default.min.css' />
<!-- including javascript -->
<script src='kendo/js/jquery.min.js'></script>
<script src='kendo/js/kendo.all.min.js'></script>
<script src="kendo/js/cultures/kendo.culture.ru-RU.min.js"></script>
<!-- setting locale -->
<script type="text/javascript">
kendo.culture('ru-RU');
</script>
的javascript:
var tasksDataSource = new kendo.data.GanttDataSource({...}); // works always
var gantt = $('#gantt').kendoGantt({
dataSource: tasksDataSource,...}); // works only if includes are in same file
我该如何修复这些错误?我做错了什么或者他们是kendo的错误吗?
完整错误文字:
! TypeError:undefined不是函数 在HTMLDocument.eval(eval at(/bower_components/jquery/dist/jquery.min.js:2:2620),:97:28) m.Callbacks.j(bower_components / jquery / dist / jquery.min.js:2:27244) at Object.m.Callbacks.k.add [as done](bower_components / jquery / dist / jquery.min.js:2:27553) m.fn.ready(bower_components / jquery / dist / jquery.min.js:2:29659) 在eval(eval at(bower_components / jquery / dist / jquery.min.js:2:2620),:3:15) 评估(原生) 在bower_components / jquery / dist / jquery.min.js:2:2620 Function.m.extend.globalEval(bower_components / jquery / dist / jquery.min.js:2:2631) 在m.fn.extend.domManip(bower_components / jquery / dist / jquery.min.js:3:23046) m.fn.extend.append(bower_components / jquery / dist / jquery.min.js:3:20507) 匿名功能)
$ GET
compositeLinkFn 更新视图
匿名功能)
$ get.Scope。$广播
state.transitionTo。$ state.transition.resolved.then。$ state.transition
deferred.promise.then.wrappedCallback
匿名功能)
$ get.Scope。$ EVAL
get.Scope。$消化 $ get.Scope。$适用
completeRequest .onreadystatechange
答案 0 :(得分:0)
嗯,通过bower install angular-gantt-chart --save
或taitems/jQuery.Gantt通过bower install jquery-gantt --save