How to put a Kendo control into a Kendo template?

I'm trying to put a NumericTextBox into a Kendo template.

Here is the code:

<script type="text/x-kendo-template" id="clone-wizard-template">
    <p>Bitte wählen Sie, wie viele Male Sie möchten <br />die Aktionsgruppe fortschreiben:
    </p>

        @(Html.Kendo().NumericTextBox()
            .Name("custom")
           .Value(10)
           .ToClientTemplate())


    <br />
/*some other lines*/
</script>

Which is strangely rendered into this:

<script type="text/x-kendo-template" id="clone-wizard-template">
    <p>Bitte wählen Sie, wie viele Male Sie möchten <br />die Aktionsgruppe fortschreiben:
   </p>

        <input class="k-input" id="custom" name="custom" type="number" value="10" /><script>
    jQuery(function(){jQuery("\#custom").kendoNumericTextBox({});});
<\/script>


    <br />
/*some other lines*/

</script>

I cannot understand from where comes </script> tag...

I'm loading a template into a modal window by using this code:

        editAktionsgruppen.kendoWindow = $("<div />").kendoWindow({
            title: "Bestätigen",
            resizable: false,
            visable: false,
            modal: true
        }).html($("#clone-wizard-template").html()).data("kendoWindow");

Isn't this a correct way to input a control in the template?

Answers


I would probably write it like this:

var popUpWindow = $("<div />").kendoWindow({
    title: "Bestätigen",
    resizable: false,
    content: {
       template: kendo.toString($('#clone-wizard-template').html())
    },
    visable: false,
    modal: true
});

//add kendo validation to popup window
$('#my-form').kendoValidator();

//initialise the numeric textbox (you could specify a class on the input and find
//by that instead instead of using an id)
$('#NumInput').kendoNumericTextBox();

//wire-up an ok/submit button
$(popUpWindow).find('.t-button').on('click', function() {
 var validator = $('#my-form').data('kendoValidator');

   if(valiator.validate()) 
   {
    // do stuff
   }
});

//show the window
$(popUpWindow).data('kendoWindow').center().open();

then the client template:

  <script type="text/x-kendo-template" id="clone-wizard-template">
<form id="my-form">
        <p>Bitte wählen Sie, wie viele Male Sie möchten <br />die Aktionsgruppe fortschreiben:
        </p>

         <input id="NumInput" name="NumInput" type="number" required data-required-msg="number required" />

        <br />
    /*some other lines*/
    <button type="button" class="t-button">my button</button>
</form>
    </script>

Need Your Help

Obtain public key from private SecKeyRef

c osx cryptography security.framework

Given a SecKeyRef loaded using SecItemImport from an RSA private key is there a way to obtain or create a SecKeyRef for only the public key components? In OpenSSL this could be done by copying the

Grunt concat: Use file instructions a la Codekit

javascript concatenation gruntjs codekit grunt-contrib-concat

I'm trying to convert a CodeKit project to use Grunt (so we can support our Windows friends).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.