我有一个带有单页仪表板的包。在这个页面上,我需要一个动态创建的对话框弹出,所以我还需要使用路由器、视图(package/mypackage/views
)和控制器。
现提出以下问题:
Router::register('what_path_?', 'Namespace\?\Class::method')
创建到视图/控制器的路由?Url::to(?)
)中的路由,并与对话框JS结合使用?如果有些问题仍未解决,请添加评论!
发布于 2015-05-05 01:29:46
要在包中的仪表板单页上创建模态对话框,必须执行以下步骤(假设包已经存在):
备注:
该路由可以被命名,无论谁想要它(例如:/superuser/needs/new/pants
)。
对话框JS上的调用可能会得到更好的处理,请评论它。
发布于 2015-05-01 12:45:30
在concrete5中,您可以使用$.fn.dialog.open
,例如:
$.fn.dialog.open({
width: 500,
height: 300,
element: $('<div>This is an example!</div>')
});
发布于 2016-03-13 08:53:50
要添加另一个“内联代码”可能性:
HTML:
<div id="my_dialog" style="display: none">
<div>
This is an example!
</div>
</div>
jQuery:
$('#my_dialog').dialog({
title: 'My Title',
width: 500,
height: 300,
modal: true,
buttons: [
{
text: 'Yes',
icons: {
primary: "ui-icon-confirm"
},
click: function () {
// Confirmed code
}
},
{
text: 'No',
icons: {
primary: "ui-icon-cancel"
},
click: function () {
$(this).dialog('close');
}
}
]
});
https://stackoverflow.com/questions/29963762
复制相似问题