【问题标题】:How to create a plugin for handsontable如何为handsontable创建一个插件
【发布时间】:2014-07-02 07:34:26
【问题描述】:

我想为handsontable 创建一个插件,并将extensions 子文件夹中的removeRow 文件复制到jquery.handsontable.myPlugin.[js|css]。 在这些文件中,我将每次 removeRow 重命名为 myPlugin 并将 RemoveRow 重命名为 MyPlugin。

在表定义中我添加了myPlugin: true。

但是插件(它仍然应该显示带有删除行的按钮的列)没有被调用。

我添加了console.log("init (removeRow)") 和console.log("init (myPlugin)") 在 init() 的两个插件中。 似乎只有 removeRow 插件被称为 bun 而不是 myPlugin。

我必须以某种方式将插件注册到可动手做吗? 我认为将这两个文件都放入扩展文件夹就足够了。

非常感谢

【问题讨论】:

    标签: plugins handsontable


    【解决方案1】:

    我不确定你想通过将 removeRow 重命名为 myPlugin 来实现什么,但请查看 Callbacks and Handsontable.PluginHooks

    var hooks = Handsontable.PluginHooks.hooks;
    

    用这个为你的插件添加钩子

    【讨论】:

    • 感谢您的回复。不幸的是,我无法尝试这个,因为我已经从 handsontable 转移到 datatables。
    猜你喜欢
    • 2013-04-17
    • 2017-05-19
    • 1970-01-01
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多