【发布时间】:2017-09-07 13:53:06
【问题描述】:
我正在尝试在散景中创建自定义保存工具,这就是我所拥有的:
class NewSaveTool(Tool):
JS_CODE = """
import * as p from "core/properties"
import {ActionTool, ActionToolView} from "models/tools/actions/action_tool"
export class NewSaveToolView extends ActionToolView
do: () ->
save_name = @model.source
@plot_view.save(save_name)
export class NewSaveTool extends ActionTool
default_view: NewSaveToolView
type: "SaveTool"
tool_name: "Save"
icon: "bk-tool-icon-save"
@define {
source: [ p.String ]
}
"""
source = String
__implementation__ = JS_CODE
该工具加载并在工具栏中,但是当我单击按钮时,我得到了
Uncaught TypeError: this.plot_view.save is not a function
这就是源码中保存工具使用的确切功能,那么有谁知道为什么它在这种情况下不起作用?
【问题讨论】:
标签: javascript python coffeescript bokeh