sap.ui.define(['sap/ui/model/json/JSONListBinding'], function (JSONListBinding) {
'use strict';
/**
* PagingJSONListBinding
* @class
* @extends sap.ui.model.json.JSONListBinding
*/
return JSONListBinding.extend('archiving-variants.javascript.GrowingJSONListBinding', {
getLength: function () {
return this.getModel()._totalCount;
}
});
});
sap.ui.define(
['archiving-variants/javascript/GrowingJSONListBinding', 'sap/ui/model/json/JSONModel'],
function (GrowingListBinding, JSONModel) {
'use strict';
/**
* PagingJSONModel
* @class
* @extends sap.ui.model.json.JSONModel
*/
return JSONModel.extend('archiving-variants.javascript.GrowingJSONModel', {
bindList: function (sPath, oContext, aSorters, aFilters, mParameters) {
return new GrowingListBinding(
this,
sPath,
oContext,
aSorters,
aFilters,
mParameters
);
}
});
}
);
sap.ui.define(
['sap/ui/core/mvc/Controller',
'archiving-variants/javascript/GrowingJSONModel'
],function(Controller,GrowingJSONModel){
return ...})
// set growing JSONModel
this._tableModel = new GrowingJSONModel([]);
this.getView().setModel(this._tableModel, 'table');
async getTableDataFun() {
this._tableModel.setData([]);
...
const Url = `path?currentPage=${currentPage}`;
const { data:tableData } = await axios.get(Url);
this._tableModel.setData([
...this._tableModel.getData(),
...tableData
]);
...
this._tableModel._totalCount = tableData.count;
}
onTableUpdateStarted(oEvent) {
if (oEvent.getParameter('reason') === 'Growing') {
this._loadGrowingData(oEvent.getParameter('actual') / 50);
}
},
async _loadGrowingData(itemIndex) {
this.currentPage = itemIndex;
const { data } = await axios.get(URL);
this._tableModel.setData([
...this._tableModel.getData(),
...data
]);
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
13 | |
12 | |
11 | |
9 | |
9 | |
7 | |
5 | |
5 | |
5 |