我有一个网格。在网格列中添加下拉按钮,然后单击按钮打开工具提示对话框,但工具提示对话框打开几秒钟后消失。
我希望当单击按钮时它会显示,而单击取消按钮时会隐藏。如果有任何想法,请提出建议。 我正在关注enter link description here
1.dialog.jsp
<table id="eventDialogInstructorTextBox" dojotype="dojox.grid.EnhancedGrid" data-dojo- props="selectionMode:'none'" style="height: 50px;width:100%;align:top;background:white;margin-left:2%">
<thead>
<tr>
<th field="id" width="85%" hidden="true">instKey</th>
<th field="name" width="90%">instData</th>
<th field=" " formatter="commentImg" width="10%"></th>
</tr>
</thead>
</table>
2.dialog.js
function commentImg(){
var dialog = new dijit.TooltipDialog({
content:
'<label for="name">Name:</label> <input data-dojo-type="dijit.form.TextBox" id="name" name="name"><br>' +
'<label for="hobby">Hobby:</label> <input data-dojo-type="dijit.form.TextBox" id="hobby" name="hobby"><br>' +
'<button data-dojo-type="dijit.form.Button" type="submit">Save</button>'
});
var button = new dijit.form.DropDownButton({
label: "",
dropDown: dialog,
// iconClass: commentButtonIcon
});
return button;
}
最佳答案
尝试在 tooltipDialog 上设置
closable : false
使用对话框。工具提示对话框在鼠标离开时关闭
关于javascript - Dojo 工具提示对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21376968/