当为customizing events for the Rappid Halo tool handles时,arguments变量似乎只有jQuery.Event对象以及x和y坐标。
如何获取单元格/元素或cellView以便对其进行操作?
发布于 2018-01-16 19:23:44
元素的视图可以通过this.options.cellView找到。删除句柄的示例:
{
name: 'remove',
position: 'ne',
events: {
pointerdown: function (evt) {
evt.stopPropagation();
var elementView = this.options.cellView;
// work on the element ...
elementView.model.remove();
}
}
}在这个特定的例子中,如果目标是独占地删除元素,那么就不需要定制函数,即:events: {pointerdown: 'removeElement'}。
https://stackoverflow.com/questions/48280118
复制相似问题