ListView widget not initialized.

4 posts, 1 answers
  1. XiMnet Malaysia
    XiMnet Malaysia avatar
    46 posts
    Member since:
    Jan 2006

    Posted 17 Oct 2014 Link to this post

    Hi,

    Was trying the Dojo (http://dojo.telerik.com/tutorial/framework-datasource) but stuck at here.
    The error returned in the Result is:

    ListView widget not initialized.

    What did I miss?

    Thanks.

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>Untitled</title>
     
       
     
      <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
      <script>
         
        var ds = new kendo.data.DataSource({
            data: [
                { text: 'Tweet 1', id: 1 },
                { text: 'Tweet 2', id: 2 },
                { text: 'Tweet 3', id: 3 },
                { text: 'Tweet 4', id: 4 },
                { text: 'Tweet 5', id: 5 }
            ]
         });
        $('#twitter').kendoListView({
               dataSource: ds,
               template: '<li>#: text #</li>'
        });
         
      </script>
    </head>
    <body>
       <ul id="twitter"></ul>
    </body>
    </html>
  2. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 21 Oct 2014 Link to this post

    Hello,

    You should use the document ready event when the script tag is added before the element in order to wait for the element to be created:
    $(function () {
        var ds = new kendo.data.DataSource({
          data: [
            { text: 'Tweet 1', id: 1 },
            { text: 'Tweet 2', id: 2 },
            { text: 'Tweet 3', id: 3 },
            { text: 'Tweet 4', id: 4 },
            { text: 'Tweet 5', id: 5 }
        ]
        });
        $('#twitter').kendoListView({
          dataSource: ds,
          template: '<li>#: text #</li>'
        });
    });



    Regards,
    Daniel
    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
  4. Grant
    Grant avatar
    8 posts
    Member since:
    Aug 2011

    Posted 20 Jul in reply to Daniel Link to this post

    Can you please fix your dojo demo because I have followed it to the letter and it doesn't work. It doesn't explain that you need to add the code to a document ready event.
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 22 Jul Link to this post

    Hello Grant,

    Thank you for the feedback! The tutorial has been updated.

    Regards,
    Alex Gyoshev
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top
Kendo UI is VS 2017 Ready