How to read SQLite data into ListView?

2 posts, 0 answers
  1. James
    James avatar
    3 posts
    Member since:
    Mar 2013

    Posted 16 May 2013 Link to this post

    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.
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 18 May 2013 Link to this post

    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.
Back to Top