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

How to read SQLite data into ListView?

1 Answer 221 Views
AppBuilder Windows client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 17 May 2013, 04:20 AM

I'm able to get the sqlite data to display on Icenium console window but not ListView. Here is my code:

var dbresult;
 
function queryDB(tx) {
    tx.executeSql('SELECT * FROM DemoTable', [], querySuccess, onError);
}
function querySuccess(tx, results) {
    dbresult = results;
    var len = results.rows.length;
    console.log("DEMO table: " + len + " rows found.");
    $("#displayResult").empty();
     
    for (var i = 0; i < len; i++) {
        console.log("ID =  " + results.rows.item(i).id + "Data = " + results.rows.item(i).data);
    }
     
    $("#myListView").kendoMobileListView({
        dataSource:  kendo.data.DataSource.read({data: results.rows.item().id, group: "id"}),
        template: $("#myTemplate").html(),
        fixedHeaders: true
    });
}

In index.html
<div id="myListView"></div>
 
<!--Template-->
<script type="text/x-kendo-template" id="myTemplate">
<h3>${id}</h3>
<p >${data}</p>
</script>

I think that is something wrong about my dataSource but don't know how?

can any1 help?



thanks.

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 18 May 2013, 12:50 PM
Hello James,

You cannot use the read method of the datasource this way since it is a configuration object of a new kendo datasource. Take a look at the Kendo documentation and online examples for explanations and runnable samples:
  • http://docs.kendoui.com/api/framework/datasource#methods-read
  • http://demos.kendoui.com/web/listview/remote-data.html

In general, since your inquiry seems to be more related to Kendo UI than Icenium, we believe that you should find more relevant information and help from the community or Kendo support in the Kendo forums.

Thank you for the understanding.

All the best,
Steve
the Telerik team

Don't miss the Icenium May Release Keynote - sign up now!
Share feedback and vote for features on our Feedback Portal.
Tags
AppBuilder Windows client
Asked by
James
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or