We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

change the Task Information default position

Hello,

I'm trying to change the default position of Gantt Task Information pop-up page.

At View.cshtml:

//===========================
@(Html.EJ().Gantt("gantt")
//...
    .ClientSideEvents(cs =>
    {
        cs.ActionBegin("GanttActionBegin");
    })
//...
<script>
    function GanttActionBegin(args) {

$("#ganttsample_dialogEdit_wrapper").css("top", 30);

}
</script>
//===========================

For that, I'm trying using this script:

 $("#ganttsample_dialogEdit_wrapper").css("top", 30);

And I have bind this function in ClientSideEvents, and I have tried in ActionComplete and ActionBegin and some ClientSideEvents but it doesn't work.

Is any solution to implement the functionality?

Thanks your help.

Best regards

3 Replies

JD Jayakumar Duraisamy Syncfusion Team July 12, 2017 10:58 AM UTC

Hi Jacob, 
Please find response below, 
In Gantt ActionBegin client side event with requestType of “beforeOpenAddDialog & beforeOpenEditDialog” will be triggered before open add/edit dialog with an argument of dialog element. By using dialog element, we can get the instance and model of dialog. 
As we knew that, ejDialog have an API called position. Hence, we can set the required X & Y position of popup in the dialog model. 
Please refer following code snippet, 
function actionBegin(args) { 
 
    if(args.requestType == "beforeOpenAddDialog"){ 
    var dialogObj =  $(args.element).ejDialog("instance"), 
    model = dialogObj.model; 
    model.position.X = 300; 
    model.position.Y = 30; 
    } 
    else if(args.requestType == "beforeOpenEditDialog"){ 
        var dialogObj = $(args.element).ejDialog("instance"), 
    model = dialogObj.model; 
    model.position.X = 300; 
    model.position.Y = 30;    } 
        } 
We have also prepared a sample for your reference. Please find the sample location as below, 
Please let us know, if you require any other assistance. 
Regards, 
Jayakumar D 



JA Jacob July 14, 2017 02:27 AM UTC

Thanks,

I'm glad for this solution.

Now I  know how to change the position of popup.

Best regards.



JD Jayakumar Duraisamy Syncfusion Team July 14, 2017 03:57 AM UTC

Hi Jacob, 
We are glad that your requirement has been met. Please let us know if you need any other assistance. 
Regards, 
Jayakumar D 


Loader.
Live Chat Icon For mobile
Up arrow icon