Declined
Last Updated: 15 Oct 2021 16:34 by ADMIN
John
Created on: 06 Oct 2021 20:53
Category: UI for ASP.NET MVC
Type: Bug Report
0
When using a custom popup editor in the grid, double-slash comments break it
Pretty easy to reproduce.  Have a standard comment in javascript in a custom grid popup editor like this:

<script> 
    //my amazing function|
function() {
  var x = 0;
  doSomething();
}


Your grid will "minify" this into a single line when including the popup code as an editor template.  This will break everything because javascript will treat everything after the double-slashes as a comment, which means the entire popup is now gone.

This has been an ongoing issue for years and we expected that your code would someday be smart enough to strip comments when minifying the popup (which minifying is supposed to do anyway) or perhaps convert them so they open and close.  

Note:  I realize it's not really a "minify" since it keeps the same variables but it's about as well as i can describe what's going on.

The requested solution is simply to strip comments out when pulling in the custom popup editor, as they are pretty much useless when the entire popup is in a single line anyway.
3 comments
ADMIN
Ivan Danchev
Posted on: 15 Oct 2021 16:34

John,

Here's the feature request created on your behalf: https://feedback.telerik.com/aspnet-mvc/1539496-when-using-a-custom-popup-editor-in-the-grid-double-slash-comments-break-it

I would advise voting for it, as the number of votes is taken into account when planning features for specific releases.

Regards,
Ivan Danchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

John
Posted on: 13 Oct 2021 19:38
if you could submit it, that would be great.  We, in general, use the other comment style but occasionally we will try example code from the forums or StackOverflow in an editor and it has comments of the wrong type, or a developer will forget and get a random seemingly unrelated error such as javascript function not defined (because it ends up commented).  
ADMIN
Ivan Danchev
Posted on: 13 Oct 2021 18:37

Hello John,

We don't have have a stripping-comments logic implemented for the templates. If you want to you can log this as a feature request, or I can do it on your behalf.

As for how to have comments and still keep your js logic functioning, you can use the following comment syntax:

<script>
	/*some comment*/
	(function () {
		alert(1)
	})();
</script>

 

Regards,
Ivan Danchev
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.