I am encountering an issue with loading all the elements of an array from my ExpressJS backend to my frontend framework OpenUI5. Despite having an array of 520 elements, only the first 100 elements are being loaded into the model. How can I ensure that all array elements are properly loaded into my model?
Here is the code snippet used to load the model:
onAfterRendering: function () {
var that = this;
var businessQuery= $.ajax({
type: "GET",
url: '/getAllBusinesses',
dataType: "json"
});
$.when(businessQuery).done(function (oBusinesses) {
that.businessModel= new sap.ui.model.json.JSONModel();
that.businessModel.setData(oBusinesses[0].franchisees); // Franchisees is an array of 520 elements
that.getView().setModel(that.businessModel, 'businessModel');
});
$.when(businessQuery).fail(function (jqXHR, textStatus, errorThrown) {
console.log(errorThrown);
});
},
My view where the model is bound to a table is as follows:
var oBusinessListColumn = new sap.m.ColumnListItem({
cells: [
new sap.m.Button({
icon: '{businessModel>picture/data/url}',
text: '{businessModel>name}',
type: sap.m.ButtonType.Transparent,
press: [oController.showBusiness, oController]
}),
new sap.m.Button({
icon: 'img/Revember32_32.png',
text: {
path: 'businessModel>presentInRevember',
formatter: jQuery.proxy(oController.formatPresentInRevember, oController)
},
type: sap.m.ButtonType.Emphasized,
press: [oController.invitePressed, oController]
})
]
});
var oBusinessTable = new sap.m.Table('js-myBusiness-oBusinessTable', {
fixedLayout: false,
columns: [
new sap.m.Column({
header: new sap.m.Label({text: 'Business'})
}),
new sap.m.Column({
header: new sap.m.Label({text: 'Status'})
})
],
layoutData: new sap.ui.layout.GridData({span: "L12 M12 S12"})
}).addStyleClass('css-alignHorizontalCenter css-sTopBottomMargin card');
oBusinessTable.bindAggregation('items', 'businessModel>/', oBusinessListColumn);
Upon rendering the table, only the first 100 elements of the model are displayed instead of all 520 elements.
Regards, Chidan