【发布时间】:2020-09-01 13:01:06
【问题描述】:
我创建了一个按钮,可以在单击时展开节点。但是在单击事件之后,按钮的文本不会变为减号。
如何仅更改一个节点的单击事件按钮的文本?
$("Button", {
cursor: "pointer",
name: 'TREEBUTTON',
width: 20, height: 20,
alignment: go.Spot.TopRight,
alignmentFocus: go.Spot.Center,
// customize the expander behavior to
// create children if the node has never been expanded
click: function (e, obj) { // OBJ is the Button
var node = obj.part; // get the Node containing this Button
if (node === null) return;
e.handled = true;
expandNode(node);
}
}, $(go.TextBlock, "+"));
【问题讨论】:
-
请提供一个您正在使用但不起作用的代码示例。
-
添加按钮的代码
-
使用
button而不是Button -
按钮工作
-
如何更改按钮的文字?
标签: javascript jquery gojs