This is a migrated thread and some comments may be shown as answers.

ListView widget not initialized.

3 Answers 160 Views
ListView
This is a migrated thread and some comments may be shown as answers.
XiMnet Malaysia
Top achievements
Rank 1
XiMnet Malaysia asked on 17 Oct 2014, 09:42 AM
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>

3 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 21 Oct 2014, 07:46 AM
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!
 
0
Ian
Top achievements
Rank 1
answered on 20 Jul 2016, 09:43 PM
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.
0
Alex Gyoshev
Telerik team
answered on 22 Jul 2016, 09:41 AM

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.
 
Tags
ListView
Asked by
XiMnet Malaysia
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ian
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or