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

Position EditMode.DialogTemplate in center of screen

Hi,

Is it possible to center the dialog (edit mode =EditMode.DialogTemplate) in the center of the screen when it is opened? At the moment it's opening where ever the grid is, but the grid is sometimes quite far down on the page.

Thanks

1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 2, 2019 11:20 AM UTC

Hi Malcom, 

Thanks for contacting Syncfusion Support. 

Query#:- At the moment it's opening where ever the grid is, but the grid is sometimes quite far down on the page. 

We have checked your query and achieved your requirement using ActionComplete event of the Grid. By using the target property of ejdialog we can change the dialog position. And also Set the desire target to the dialog in the beforeOpen event.  

@(Html.EJ().Grid<object>("FlatGrid")  
                               ………………………  
                                .Columns(col =>  
                                {  
                                    …………………..  
                               })  
                                          .ClientSideEvents(eve => { eve.ActionComplete("complete"); }))  
  
</div>  
<script type="text/javascript">  
    function complete(args) {  
        if (args.requestType == "beginedit" || args.requestType == "add") {  
  
            $("#" + this._id + "_dialogEdit").ejDialog({  
                 ………………..  
                beforeOpenfunction (args) {  
                    $("#" + this._id + "_dialogEdit").ejDialog({ target: ".body-content" }) // define your target  (or) here.  
                }  
            }).ejDialog("open");  
  
  
        }  
    }  
</script>  


Refer the below links for help documentation,  


Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 



Loader.
Up arrow icon