英文:
how to drag only header in syncfusion scheduler dialog
问题
net core C# syncfusion scheduler.
我使我的日程安排对话框可拖动
function OnPopupOpen(args) {
var dragElement = document.getElementById('schedule_dialog_wrapper');
var draggable = new ej.base.Draggable(dragElement, { clone: false });
但我想要只有在拖动标题栏时才能拖动
但是我的对话框可以在任何地方拖动...像这样...
https://drive.google.com/file/d/1obbc0ti8TgWrG6U8A9igqLtxE0fIKMor/view?usp=sharing
英文:
net core C# syncfusion scheduler.
I made my scheduler's dialog draggable
function OnPopupOpen(args) {
var dragElement = document.getElementById('schedule_dialog_wrapper');
var draggable = new ej.base.Draggable(dragElement, { clone: false });
but I want make drag only I drag the header
but my dialog is draggable anywhere... like this...
https://drive.google.com/file/d/1obbc0ti8TgWrG6U8A9igqLtxE0fIKMor/view?usp=sharing
答案1
得分: 1
你可以在日程安排的弹出窗口打开事件中使用对话框的allowDragging属性,只有拖动对话框标题栏才能进行拖动,而不是整个对话框,如下所示。
allowDragging UG: https://ej2.syncfusion.com/aspnetcore/documentation/dialog/getting-started#draggable
演示: https://ej2.syncfusion.com/aspnetcore/Dialog/Draggable#/fluent
function onPopupOpen(args)
{
var dialogInstance = document.querySelector(".e-dialog").ej2_instances[0];
dialogInstance.allowDragging = true;
}
英文:
You can make drag only when drag the header of dialog instead of full dialog by using the Dialog’s allowDragging property in the Schedule’s popupOpen event, as shown in the below shared snippet.
allowDragging UG: https://ej2.syncfusion.com/aspnetcore/documentation/dialog/getting-started#draggable
Demo: https://ej2.syncfusion.com/aspnetcore/Dialog/Draggable#/fluent
function onPopupOpen(args)
{
var dialogInstance = document.querySelector(".e-dialog").ej2_instances[0];
dialogInstance. allowDragging = true;
}
答案2
得分: 0
不使用位置API,您可以使用刷新方法来实现您的需求,如下所示的代码片段中所示。
function onPopupOpen(args)
{
var dialogInstance = document.querySelector(".e-dialog").ej2_instances[0];
dialogInstance.allowDragging = true;
dialogInstance.target = '.e-schedule';
dialogInstance.refresh();
}
英文:
Instead of the position API, you can use the refresh method to achieve your requirement, as shown in the below shared snippet.
function onPopupOpen(args)
{
var dialogInstance = document.querySelector(".e-dialog").ej2_instances[0];
dialogInstance.allowDragging = true;
dialogInstance.target = '.e-schedule';
dialogInstance.refresh();
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论