Infinite list using websql proxy store

107 views Asked by At

Is there support for an infinite list backed by the websql proxy? It doesn't seem so, as whether infinite is true or false, there are only 25 items in the list.

2

There are 2 answers

0
jacob On BEST ANSWER

I was able to get this to work by modifying the Sql proxy to include total record count. More specifically, in the selectRecords method I had to change the code:

result.setTotal(count);

to a second executeSql call that queries all records. The sql statement is similar to the original one, except that (1) it does not include the LIMIT expression; and (2) the SELECT * should be SELECT COUNT(*) AS TotalCount. Then read TotalCount value from the first row of the result set, call result.setTotal(totalCount), and finally fire the callback.

0
Sagar Khatri On

You should use ListPaging plugin in the list.

{
    xclass: 'Ext.plugin.ListPaging',
    autoPaging: true,
    loadMoreText : 'Loading more',
    noMoreRecordsText : 'loaded'
}

Please check sencha touch documentation for further info.