$create ignored

2 posts, 0 answers
  1. Russ
    Russ avatar
    49 posts
    Member since:
    Sep 2006

    Posted 30 Dec 2013 Link to this post

    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?

  2. Ivan
    Admin
    Ivan avatar
    106 posts

    Posted 02 Jan 2014 Link to this post

    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.
  3. DevCraft banner
Back to Top