Uncaught TypeError: Cannot read property 'replace' of undefined

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

    Posted 12 Dec 2014 Link to this post

    I keep getting this error. The template names matches. Can you please look intog this

    <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 id="listBTemplate" type="text/x-kendo-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>
    //Javascript snippet causing the issue:
      var _listB = $("#listB").kendoListView({
            dataSource: [],//listB_DS
    template: kendo.template($("#listBTemplate").html()),
    selectable: "multiple"
        }).data("kendoListView");
  2. Petyo
    Admin
    Petyo avatar
    2438 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