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

Dialog Footer Template not displayed / formatted correcty

I've tried for a long time to show up two buttons in the Dialog's footer. They won't be displayed, whatever I try to do the buttons only show as a tiny rectangle without a caption (see screenshot). Any suggestions? All the other controls are displayed correctly.

Screenshot

@(Html.EJ()
    .Dialog("messageBox")
    .Title("Message")
    .IsResponsive(true)
    .EnableModal(false)
    .ShowOnInit(false).ShowFooter(true).FooterTemplateId("messageBoxFooter")
    )

<script id="messageBoxFooter" type="text/x-jsrender">
    <div>
        @Html.EJ().Button("btn1").Size(ButtonSize.Large).Text("OK")
        @Html.EJ().Button("btn2").Size(ButtonSize.Mini).Text("Cancel")
    </div>
</script>

8 Replies

ES Ezhil S Syncfusion Team August 25, 2017 05:25 AM UTC

Hi Robert, 

Thank you for contacting Syncfusion support.  

We have prepared sample based on the code and screenshot shared, yet we are unable to reproduce the issue reported in Dialog footer. Could you please check whether you are facing any console error on opening Dialog? Or else share us exact scenario where you have used Dialog control. We have attached sample prepared in the following link, please ensure it in your end and let us know if you face similar issue with buttons in footer. If not modify the sample based on your application to reproduce the issue and share the modified sample or code blocks. 

Please let us know if you need further assistance.  
 
Regards, 
Ezhil S 



RG Robert Glaser August 25, 2017 06:59 AM UTC

Thank you very much for your quick reply and for the sample provided. The sample works well in my enviroment - as long as I set the 'UnobtrusiveJavaScriptEnabled' setting in my Web.config to false.

In my application I work with

<add key="UnobtrusiveJavaScriptEnabled" value="true" />

If you set that to true in the sample the problem with the two tiny (unstyled?) buttons remains. Could this be a place to start further investigations? Thank you!




NP Narayanasamy Panneer Selvam Syncfusion Team August 28, 2017 12:09 PM UTC

Hi Robert, 
 
Thanks for your reply, 
 
Query: If you set that to true in the sample the problem with the two tiny (unstyled?) buttons remains. 
We were able to reproduce the issue with your scenario, while using our control in “UnobtrusiveJavaScriptEnabled” as “true”. To Resolve this problem you need to refer the dependent Script “ej.unobtrusive.min.js” in the _Layout.cshtml. 
 
Since the controls are rendered in JS render templates, we need to initialize the Syncfusion controls on Dialog create event. 
Code example: 
[@viewpage] 
@(Html.EJ().Dialog("messageBox").Title("Message").IsResponsive(true).EnableModal(false)                  .ShowOnInit(false).ShowFooter(true).FooterTemplateId("messageBoxFooter").ClientSideEvents(evt => evt.Create("createDialog")) 
) 
In script section: 
<script type="text/javascript"> 
        function createDialog() { 
            ej.widget.init($("#messageBox_wrapper")); 
        } 
</script> 
 
 
 
Regards, 
Narayanasamy P. 



RG Robert Glaser August 28, 2017 01:44 PM UTC

Thank you, this is working! Excellent support!



RG Robert Glaser August 28, 2017 02:35 PM UTC

Another small relation question about the ejDialog: Is it possible to use the Dialog as replacement for JavaScript's 'confirm' function? Like that


function actionBegin(args) {

        if (args.requestType == "delete") {

            if (!confirm('Are you sure to this?')) {  // THIS LINE

                args.cancel = true;
                return;
            }
        }
    }


If I open the Dialog in THIS LINE the function will continue executing. Is there a chance to prevent the Dialog's open function from executing the continuing code?



NP Narayanasamy Panneer Selvam Syncfusion Team August 29, 2017 12:24 PM UTC

Hi Robert,   
   
Thanks for your reply.   
   
Query:  Is it possible to use the Dialog as replacement for JavaScript's 'confirm' function?   
   
Currently there is no template for confirm function like JavaScript. You can customize our ejDialog as like javascript’s “confirm” function dialog by adding functionalities to buttons and return a value on clicking.  
 
 
If the issue persists, please revert this sample with your exact scenario. so that we can provide a prompt solution. 
 
 
Regards, 
Narayanasamy P. 



RG Robert Glaser October 9, 2017 06:25 PM UTC

Thank you for your reply and the excellent support. I found another solution for the issue.



NP Narayanasamy Panneer Selvam Syncfusion Team October 10, 2017 05:36 AM UTC

Hi Robert, 
 
We are glad that the reported issue has been resolved in your end. Please let us know if you need further assistance.  
 
Regards, 
Narayanasamy P.

Loader.
Up arrow icon