sap.ui.define([
"sap/ui/model/json/JSONListBinding"
], function (
JSONListBinding
) {
"use strict";
/**
* PagingJSONListBinding
* @class
* @extends sap.ui.model.json.JSONListBinding
*/
return JSONListBinding.extend("sap.di.mldm.model.PagingJSONListBinding", {
constructor: function (oModel, sPath, oContext, aSorters, aFilters, mParameters) {
JSONListBinding.apply(this, arguments);
},
getLength: function() {
let count = this.getModel().oData.count; //assuming model has 'count'
return this.getModel().getProperty("/" + count);
}
});
});
sap.ui.define([
"<your-namespace>/PagingJSONListBinding",
"sap/ui/model/json/JSONModel"
], function (
PagingListBinding,
JSONModel]
) {
"use strict";
/**
* PagingJSONModel
*@class
* @extends sap.ui.model.json.JSONModel
*/
return JSONModel.extend("<your-namespace>.PagingJSONModel", {
constructor: function(oRestClient) {
JSONModel.apply(this, arguments );
},
bindList: function(sPath, oContext, aSorters, aFilters, mParameters) {
return new PagingListBinding(this, sPath, oContext, aSorters, aFilters,
mParameters);
}
});
});
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns:core="sap.ui.core"
xmlns="sap.m" controllerName="<your-namespace>.Table" >
<Page showHeader="false" backgroundDesign="Solid" id="app">
<content>
<Table id="table" items="{ path: 'Model>/array' }"
growing="true" growingThreshold="20"
growingStarted="onGrowingStarted">
<columns>
<Column>
<Text text="{i18n>heading1}"/>
</Column>
<Column>
<Text text="{i18n>heading2}"/>
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Label text="{Model>property1}"/>
<Text text="{Model>property2}" />
</cells>
</ColumnListItem>
</items>
</Table>
</content>
</Page>
</mvc:View>
sap.ui.define([
"<your-namespace>/BaseController",
"sap/ui/model/json/JSONModel"
], function (BaseController, JSONModel) {
"use strict";
return BaseController.extend("sap.di.mldm.controller.table", {
onGrowingStarted: function () {
//API calls to fetch more data
}
}
});
sap.ui.define([
"sap/ui/model/json/JSONListBinding"
], function (
JSONListBinding
) {
"use strict";
/**
* PagingJSONListBinding
* @class
* @extends sap.ui.model.json.JSONListBinding
*/
return JSONListBinding.extend("sap.di.mldm.model.PagingJSONListBinding", {
constructor: function (oModel, sPath, oContext, aSorters, aFilters, mParameters) {
JSONListBinding.apply(this, arguments);
},
getLength: function() {
var count = this.getModel().oData.count; //assuming model has 'count'
return this.getModel().getProperty("/" + count);
}
});
});
sap.ui.define([
"<your-namespace>/PagingJSONListBinding",
"sap/ui/model/json/JSONModel"
], function (
PagingListBinding,
JSONModel]
) {
"use strict";
/**
* PagingJSONModel
* @class
* @extends sap.ui.model.json.JSONModel
*/
return JSONModel.extend("<your-namespace>.PagingJSONModel", {
constructor: function(oRestClient) {
JSONModel.apply(this, arguments );
},
bindList: function(sPath, oContext, aSorters, aFilters, mParameters) {
return new PagingListBinding(this, sPath, oContext, aSorters, aFilters,
mParameters);
}
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
35 | |
25 | |
13 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |