如何更改 ExtJs 中的拖放工具提示文本?

How to change drag'n drop tooltip text in ExtJs?

我有两个网格,我在其中定义了这样的拖放插件:

plugins: {
        ptype: 'gridviewdragdrop',
        dragGroup: 'secondGridDDGroup',
        dropGroup: 'firstGridDDGroup'
    },

现在,当我将一个项目从一个网格拖到另一个网格时,我看到文本“1 个选定的行”- 如何更改该文本?

使用dragText配置:

The text to show while dragging.

Two placeholders can be used in the text:

  • {0} The number of selected items.
  • {1} 's' when more than 1 items (only useful for English).

Defaults to: '{0} selected row{1}'

可以使用 onNodeOver 事件动态设置它,例如:

dd.proxy.update("<span>Custom HTML here</span>");

确保在 update() 方法调用 setStyle 时包含 HTML 标记。

http://docs.sencha.com/extjs/6.0.1/classic/Ext.dd.StatusProxy.html#method-update