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

EndlessScrolling ListView + AMS + SQL Azure

1 Answer 52 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Zweni
Top achievements
Rank 1
Zweni asked on 23 Feb 2015, 06:50 PM
Hi

I have been struggling for the past few days with Endless Scrolling on a mobile listview. I have set up my datasource and listview as the demo suggests. I have not been able to successfully get it to work (or 'press to load more' for that matter) on server-side data. The local data works as expected. I have used many different KendoUI core builds and the results are pretty much the same.

One difference I did notice though, is the type: "odata" part in the demo that refuses to work for me (500 Internal Server Error). I therefore tried a normal "GET" type on the datasource. The "GET" was odata-style (https://myserviceapi.azure-mobile.net/tables/EventTypes?$filter=businessID%20eq%2053) which is supported out of the box on Azure Tables, but endless scrolling did not work. I also tried a normal "GET" of an Azure Mobile Services api method that is basically a RESTful method that returns the same data as the odata table query in SQL Azure. None of the things I have tried work. The following code is what I have and tested with many Kendo UI Core builds.

JavaScript:
var dataSource = new kendo.data.DataSource({
                                                   transport: {
                                                                       read: {
                                                                                     url: 'https://myserviceapi.azure-mobile.net/tables/EventTypes?$filter=businessID%20eq%20' + busID,
                                                                                    dataType: "json"
                                                                                 }
                                                                   },
                                                   serverPaging: true,
                                                   pageSize: 12
 });
 
 
 
$("#photoHolder").kendoMobileListView({ 
                                              dataSource: dataSource,
                                              template: "<p>#: eventName #</p>",
                                              endlessScrolling: true,
                                              filterable:{
            field: "eventName",
            operator: "contains",
            ignoreCase: true,
            placeholder: "search products..."
        }
 });



HTML:
<ul  id="photoHolder" data-role="listview">
</ul>


SQL. Also tried using this SQL in the non-odata Azure Mobile Service API method that's in NodeJS. The datasource will parse the page and pageSize Query and I manually add the busID when I'm not using an odata query:
exports.get = function(request, response) {
    var mssql = request.service.mssql;
    var cnt = request.query.pageSize;
    var pnm = request.query.page;
 
    var sql = "SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY zOrder) AS RowNum, * FROM myschema.EventTypes where (businessID = " + request.query.busID + ") and active = 1) AS E " +
        "WHERE RowNum BETWEEN ((" + pnm + " - 1) * 20 + 1) AND (" + pnm + " * " + cnt + ") ORDER BY zOrder";
 
    mssql.query(sql, {
        success: function(results) {
            response.send(200, results);
        },
        error: function(err) {
            console.log(err);
            response.send(530, { error: err });
        }
    });
};

1 Answer, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 26 Feb 2015, 01:22 PM
Hello Zweni,

I would kindly ask you to consider purchasing a Kendo UI Professional subscription in order to benefit from Telerik support service related Kendo. However you can still exchange information and share knowledge with our community using the forum threads.
The current thread is in the AppBuilder section so in order to increase the chance of receiving answer from our community I would suggest addressing your questions in the appropriate Kendo UI forum or a public forum like StackOverflow.
Thank you.

Regards,
Zdravko
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apache Cordova
Asked by
Zweni
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Share this question
or