Error with Kendo Template

2 posts, 0 answers
  1. Adeeb
    Adeeb avatar
    2 posts
    Member since:
    Oct 2014

    Posted 12 Dec 2014 Link to this post

    Greetings,
       I am getting this error: uncaught TypeError: Cannot read property 'replace' of undefined. I tried everything PLease HELP!
    Below is the source code:
    <html>
    <head>
        <title>>Factory Candidates screen</title>
        
      
       <link href="https://prdeuonline.kidkraft.com/scripts/telerik/styles/kendo.common.min.css" rel="stylesheet">
       <link href="https://prdeuonline.kidkraft.com/scripts/telerik/styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="https://tryarcllc.quickbase.com/db/biw8k3f8k?a=dbpage&pageID=64" rel="stylesheet">
     <!--  <link href="https://prdeuonline.kidkraft.com/scripts/telerik/styles/kendo.default.min.css" rel="stylesheet"> -->
       <link href="https://prdeuonline.kidkraft.com/scripts/telerik/styles/kendo.dataviz.min.css" rel="stylesheet">
       <link href="https://prdeuonline.kidkraft.com/scripts/telerik/styles/kendo.dataviz.default.min.css" rel="stylesheet">
       <link href="https://prdeuonline.kidkraft.com/scripts/telerik/styles/kendo.mobile.all.min.css" rel="stylesheet" />
       <script src="https://prdeuonline.kidkraft.com/scripts/telerik/js/jquery.min.js"></script>
       <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
       <script src="https://prdeuonline.kidkraft.com/scripts/telerik/js/cultures/kendo.culture.de-DE.js"></script>
       <script src="https://prdeuonline.kidkraft.com/scripts/telerik/js/kendo.all.min.js"></script>
       <script src="https://tryarcllc.quickbase.com/db/biw8k3f8k?a=dbpage&pageID=56"></script>
       <script src="https://tryarcllc.quickbase.com/db/biw8k3f8k?a=dbpage&pageID=60"></script>
       <script src="https://tryarcllc.quickbase.com/db/biw8k3f8k?a=dbpage&pageID=62"></script>
       <script src="https://tryarcllc.quickbase.com/db/biw8k3f8k?a=dbpage&pageID=63"></script>
       <script src="https://tryarcllc.quickbase.com/db/biw8k3f8k?a=dbpage&pageID=67"></script>
       <script src="https://tryarcllc.quickbase.com/db/biw8k3f8k?a=dbpage&pageID=68"></script>
        
    </head>
    <body>


     Please select factories from available factories list:

    <table>
    <tr><th>Available factories</th><th>         </th><th>Selected factories</th></tr><th>         </th>
    <tr>
    <td><div id="listA"></div></td>
    <td><button id='right'> Add</button></td>

    <td>
    <script type="text/x-kendo-template" id="template">

    # if (packout === false){#
    <div class='item'> #: name #  
    <label class='chkbox'> <input  id=#=uid#  type='checkbox' onClick='packout(this.id)'> 
    packout? 
    </label>
    </div>
    # }else if(packout === true) { #
    <div class='item'> #: name #  
    <label class='chkbox'> <input  id=#=uid#  type='checkbox' onClick='packout(this.id)'  checked>
    packout? 
    </label>
    </div>
    #}#

    </script>
    <div id="listB"></div>
    </td>

    <td><button id='left'>Remove</button></td>
    </tr>
    <tr>
    <td><button id="saveButton">Save</button></td>
    <td><button id="cancelButton">Close</button></td>
    </tr>
    </table>


    <style>
        #listA, #listB {
    width: 400px;
            height: 600px;
    overflow: auto;
            float: left;
            margin-right: 30px;
            border: 3px solid black;
            border-radius: 3px;
        }

        .item {
            margin: 5px;
            padding: 5px;
            text-align: left;
            border: 2px solid #ccc;
            border-radius: 5px;
        }
        .chkbox{
    float:right;
         }
    </style>
    </body>
    </html>
    //This is the portion of the script causing the error.
     var _listB = $("#listB").kendoListView({
            dataSource: [],//listB_DS
    template: kendo.template($("#template").html()),
    selectable: "multiple"
        }).data("kendoListView");








  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 13 Dec 2014 Link to this post

    Hello Adeeb,

    I tried to reproduce the issue based on your code, and it does not result in the error you describe. Perhaps I am missing something?

    Regards, Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
     
  3. Kendo UI is VS 2017 Ready
Back to Top