Skip to Content
avatar image
Former Member

Load huge data

Hello everybody,

I have a server query with 70,000 records. This takes about 6 seconds. This data I insert into a m.Table.

My question is now, if I only want to display the first 100 records and only by scrolling another 100, I still have to load the complete data set (70,000) before? Or is it possible to query the files from the server only when scrolling?

Best regards

Yannick

Add comment
10|10000 characters needed characters exceeded

  • I'd strongly discourage using sap.m.Table over sap.ui.table.Table if you need to display more than about 100 items. Even Chrome will face performance issues. IE was unusable in my experience because of that. sap.ui.table.Table solves the problem because its DOM element doesn't "grow" as List does. When scrolling occurs and your OData is bound to the table directly (without a JSONModel in between), UI5 will handle updating data automatically by sending requests with "top" & "skip", which enables dealing with a huge amount of data seamlessly.

    The only disadvantage of sap.ui.table.Table is that its design is not responsive.

  • Get RSS Feed

2 Answers

  • Feb 02, 2017 at 05:26 PM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thank you very much! I've changed it to this:

      onInit : function() {
          var oModel = new sap.ui.model.odata.ODataModel("EmployeeODataService.xsodata/", true);
          var jsonModel = new sap.ui.model.json.JSONModel();
          oModel.read("/Employee?$top=50",null,null,true,function(oData,response){
               jsonModel.setData(oData.results)
               this.getView().setModel(jsonModel, "employees");
               fetchedRecords = fetchedRecords + 50;
          }.bind(this));
      },
      
      grow : function() {
          var oModel = new sap.ui.model.odata.ODataModel("EmployeeODataService.xsodata/", true);
          oModel.read("/Employee?$skip="+fetchedRecords+"&$top=50", null,null,true, function(oData){
               var oTableModel = this.getView().getModel("employees"); //Get your table model
               var aTableData = oTableModel.getData(); // Get entries
               aTableData.push.apply(aTableData, oData.results); // Add more entries
               oTableModel.setData(aTableData); // // Update model
               fetchedRecords = fetchedRecords + 50;
          }.bind(this));
      }
      <br>
  • Feb 03, 2017 at 02:26 PM

    A user is going to spend time scrolling through 70,000 records? I think they should get a medal for patience. My best suggestion would be to review the business process instead of trying to handle it in code.

    Add comment
    10|10000 characters needed characters exceeded