将名称添加到 JQuery 对话框底部按钮
我正在尝试将名称(不是显示的文本)添加到底部面板上的按钮,但找不到方法。
这就是我到目前为止所拥有的......
$("#dialog-import-from-existing").dialog({
title: "Import From Existing",
autoOpen: false,
modal: true,
draggable: false,
resizable: false,
width: 500,
height: 525,
buttons: {
**name : "SubmitButton",**
"Import": function() {
$('#CreateForm').submit();
$(this).dialog('close');
},
"Cancel": function() {
//Need to added the js files to Driver studio.
//$("models-to-add-container").effect("explode");
$(this).dialog('close');
}
}
});
我试图让这个按钮的名称为“SubmitButton”。
提前致谢。
I am trying to add a name(not the text shown) to a button on the bottom panel and can't find a way to do it.
This is what I have so far...
$("#dialog-import-from-existing").dialog({
title: "Import From Existing",
autoOpen: false,
modal: true,
draggable: false,
resizable: false,
width: 500,
height: 525,
buttons: {
**name : "SubmitButton",**
"Import": function() {
$('#CreateForm').submit();
$(this).dialog('close');
},
"Cancel": function() {
//Need to added the js files to Driver studio.
//$("models-to-add-container").effect("explode");
$(this).dialog('close');
}
}
});
I'm trying to have this button with the name "SubmitButton".
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
按钮选项有两个 API。您正在使用原始的、更简单的 API 将按钮标签映射到单击函数。您还可以使用对象数组,这给您更多的控制权。
此 API 允许您传递任何可以传递给
.attr()
以及事件处理程序的内容。The button option has two APIs. You're using the original, simpler API of mapping the button label to a click function. You can also use an array of objects, which gives you much more control.
This API allows you to pass anything that can be passed to
.attr()
plus event handlers.尝试:(
精炼自 jQuery UI 对话框按钮图标)
Try:
(Refined from jQuery UI Dialog Button Icons)