Data-Template and Source binding with useWithBlock

5 posts, 0 answers
  1. Roland
    Roland avatar
    17 posts
    Member since:
    Aug 2012

    Posted 16 Jul 2012 Link to this post

    How can i define a data-template with a source binding using the useWithBlock:false

    I have something like the following
    <ul data-template="itemtemplate" data-bind="source: Data">

    and my template
    <script id="itemtemplate" type="text/x-kendo-template">
          <label data-bind="text: Description">

    but I want that my template will be rendered with the useWithBlock property set to false

  2. jstott
    jstott avatar
    6 posts
    Member since:
    Jan 2008

    Posted 25 Jul 2012 Link to this post

    Stumped on this one as well?
  3. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 26 Jul 2012 Link to this post


     Currently Kendo MVVM initializes the templates with default configuration. This means that useWithBlock is always set to true. There is no way to override this unless the source code is modified.

    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  4. Jonathan M
    Jonathan M avatar
    16 posts
    Member since:
    Sep 2012

    Posted 11 Dec 2012 Link to this post

    I know this is an older thread, but I had the same question come up today and thought I'd share my solution.

    I just put this in a script block that runs before my template is initialized:

    kendo.Template.useWithBlock = false;

    Hope this helps someone.


  5. Dan
    Dan avatar
    7 posts
    Member since:
    Jul 2012

    Posted 25 May Link to this post

    I took the modified source code route to solve my problem.  Performance in IE11 (still used by many on our corporate network) was abysmal, ranging from 60-90 seconds to load a very data-heavy page.  By turning off the useWithBlock on the biggest ListView on the page, it now loads in a more "acceptable" 15 seconds.  Using the 2016.1.412 release of, I modified the parseOptions method at line 2200 as follows:

    function parseOptions(element, options) {
        var result = {}, option, value;
        for (option in options) {
            value = parseOption(element, option);
            if (value !== undefined) {
                if (templateRegExp.test(option)) {
                    var useWithBlock = !(element.getAttribute('data-use-with-block') === 'false');
                    value = kendo.template($('#' + value).html(), { useWithBlock: useWithBlock });
                result[option] = value;
        return result;

    By adding the data-use-with-block="false" attribute to my mobile ListView widget, I can now specify the behavior on a per-control basis. Hope that helps!

Back to Top