This is a migrated thread and some comments may be shown as answers.

$create ignored

1 Answer 31 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Russ
Top achievements
Rank 1
Russ asked on 30 Dec 2013, 07:39 PM
I created a template to insert some javascript into my user control:

I created a template with the following:

Sys.Application.add_load(function () {
$create(Company.Controls.REPLACEME, null, null, null, $get('<%=Me.ClientID%>'));
var ctl = $find('<%= Me.ClientID%>');
ctl.setup();
});

This was the output:

Sys.Application.add_load(function () {

get('<%=Me.ClientID%>')

);

var ctl =

The issue is related to the $create and $find in the template.  Any way around this?

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 02 Jan 2014, 09:06 AM
Hello,

Since JustCode uses the "$" symbol for defining variables in the templates, you need to escape it by adding a second "$". That is - your template should look something like:
Sys.Application.add_load(function () {<BR>$$create(Company.Controls.REPLACEME,
null, null, null, $$get('<%=Me.ClientID%>'));<BR>var ctl = $$find('<%=
Me.ClientID%>');<BR>ctl.setup();<BR> });<BR>


Regards,
Ivan
Telerik
Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
Tags
General Discussions
Asked by
Russ
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or