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

$(....).data('ejDialog') does not work but $(..).ejDialog() does

having this strange issue with the dialog with asp.net. it was working fine with the <ej:Dialog ...><DialogContent></DialogContent></ej:Dialog>.
but now it does not work for some reason. trace the js, turns out that the call $(....).data('ejDialog') does not work but $(..).ejDialog() does.

.data('ejDialog') returns undefined. what went wrong? (we are using the minified ej.dialog.min.js generated from the syncfusion generation tool)

could it be the assemble license issue? it should not since .ejDialog() is working fine.

3 Replies

KE Kevin September 10, 2016 06:23 PM UTC

turns out this setting breaks all the syncfusion controls


  <add key="webpages:Version" value="3.0.0.0" />

    <add key="webpages:Enabled" value="false" />

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

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


to fix this issue, one need to add this script reference

<script src="http://cdn.syncfusion.com/13.1.0.21/js/assets/scripts/common/ej.unobtrusive.min.js"></script>
but this script has reference to widget.

now if just using one control, say the dialog, we don't want to reference the entire 1.1M ej.widget.all.min.js

how to make it work for individual control then?



KE Kevin September 10, 2016 06:42 PM UTC

<add key="UnobtrusiveJavaScriptEnabled" value="true" />  actually breaks the dialog control, its content no longer render properly. it's just showing a blank dialog. why is it such a a pain to use these controls?? (spending hours and hours hunting down this little hidden bugs :(


SS Selvamani Sankarappan Syncfusion Team September 12, 2016 01:01 PM UTC

Hi Kevin, 
Thanks for Contacting Syncfusion Support, 
Query “now it does not work for some reason. trace the js, turns out that the call $(....).data('ejDialog') does not work but $(..).ejDialog() does. 
We can render the dialog control to using this $(..).ejDialog(). Then we get the object of the Dialog control using this $(....).data ('ejDialog') or $(....).ejDialog(“instance”). 
Query“<scriptsrc="http://cdn.syncfusion.com/13.1.0.21/js/assets/scripts/common/ej.unobtrusive.min.js"></script> but this script has reference to widget. “ 
This script file not control dependent. This is the common for all the components. 
Query “now if just using one control, say the dialog, we don't want to reference the entire 1.1M ej.widget.all.min.js 
Yes, No need to refer the ej.widget.all.min.js file for one control. We can download for the control dependency files alone using CSG. 
Please refer the following link: 
Query “<add key="UnobtrusiveJavaScriptEnabled" value="true" />  actually breaks the dialog control, its content no longer render properly. it's just showing a blank dialog. 
We have checked with your code example. And we are able to re-produce the reported issue in our end. In default, <add key="UnobtrusiveJavaScriptEnabled" value="true" /> using Unobtrusive mode enabled for ASP.NET MVC. 
Please check with the below link: 
For validating purpose only, if you are enabling the un- obtrusive mode in asp.net. Please check with the below link: 
Please let us know which platform you are currently using in your application. 
Regards, 
Selvamani S 


Loader.
Up arrow icon