在剑道图表中,工具提示未正确显示

时间:2013-04-03 05:11:32

标签: kendo-ui

enter image description here我正在研究剑道控制。我在我的应用程序中有剑道股票图表。我正在为图表提供工具提示功能。但它没有显示值,它显示的值为“未定义”。使用该事件时,我们可以自定义栏\折线图的工具提示。传递给事件的数据项将作为未定义返回。那么,是否存在我可以设置的属性,允许自定义工具提示,即使它们在很小的区域中有很多琐事。示例:template:“#= dataItem.employeeName#”。我的图表代码有什么问题?

2 个答案:

答案 0 :(得分:2)

在您的代码中,您必须在模板定义#= dataItem.<fieldName> #中使用,例如:Freight :#=dataItem.Freight# <br/>,因为KendoUI data处理器收到的template结构为{{1} }}

所以你的模板应该是:

dataItem.<fieldName>

注意作为调试技巧,您可以定义为template: "#OrderDate:#=dataItem.OrderDate# <br/>Freight :#=dataItem.Freight# <br/>ShipVia:#=dataItem.ShipVia# <br/> ShipCity:#= dataItem.ShipCity#"

template

这将执行template: "#console.log('data', data);#" 所包含的代码。 Kendo UI模板管理器将您可用的实际数据定义为#,如:

data

这样可以正确使用using(data) { // Template expanded code }; ,但不会阻止您继续使用#= dataItem.ShipCity #。我们利用这一点在浏览器控制台上显示data并检查其结构。

您在此处修改过的JSFiddle:http://jsfiddle.net/OnaBai/5bchz/64/

答案 1 :(得分:0)

#debugger;#关键字添加为javascript块的kendo UI模板中的断点。 打开浏览器控制台。浏览器自动点击断点。

相关问题