sencha list paging plugin

前端 未结 5 1574
渐次进展
渐次进展 2021-02-10 06:38

I\'m trying to use sencha touch\'s listpaging plugin. But there is almost no good( or bad ) documentation about how to use it and i\'m confused.

When i activate the plu

5条回答
  •  一整个雨季
    2021-02-10 07:17

    In regards to the "load more vs. no more records" message -

    If you are writing a custom proxy (example here A Sencha Touch MVC application with PhoneGap), you set the total records in the returned Operation.

    If the total records are not yet known, you can do something like the below, where,

    1) if you are returning the requested limit of records, set the total to something larger than the records the store will now hold

    2) if returning < the requested limit of records, set the total to 1 (to force the "no more records message")

        //return model instances in a result set
        operation.resultSet = new Ext.data.ResultSet({
            records: contacts,
            //total  : contacts.length,
            total  : contacts.length === operation._limit ? (operation._limit * operation._page +1) : 1,
            loaded : true
        });
        //announce success
        operation.setSuccessful();
        operation.setCompleted();
        //finish with callback
        if (typeof callback == "function") {
            callback.call(scope || thisProxy, operation);
        }
    

提交回复
热议问题