gpt4 book ai didi

jointjs - 不触发单元格事件

转载 作者:行者123 更新时间:2023-12-02 15:54:51 25 4
gpt4 key购买 nike

我有一份带有图表的工作文件。我已向图表中添加了多个单元格,并且正在尝试监听 cell:highlight 事件,但我从未收到它。

我正在做:

paper.on('cell:highlight', function() { ... });

其他事件似乎工作正常,例如:blank:pointerup,...

是否需要采取一些特殊措施才能使细胞事件发挥作用?

最佳答案

根据文档:

cell:highlight - triggered when highlight() method is called on either an element or a link. Note that this method is also called automatically when the user is reconnecting a link and the connection is valid (validateConnection() returns true) or if embeddingMode is enabled on the paper and the dragging element is above another element it could be dropped into (validateEmbedding() returns true). The handler for this event has the following signature: function(cellView,el). The handler defaults to function(cellView, el) {
V(el).addClass('highlighted') }
. In other words, the 'higlighted' CSS class is added and so you can style the highlighted element in CSS. If you want to use a different method for highlighting cells, call paper.off('cell:highlight') first to unregister the default handler and then paper.on('cell:highlight', myHandler) to register your own.

您可以阅读更多相关信息here .

关于jointjs - 不触发单元格事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34904621/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com