cancel
Showing results for 
Search instead for 
Did you mean: 

sap.ui.table.Table : Fixed first Row

former_member190939
Participant
0 Kudos

Hello Experts,

my sap.ui.table.Table's first row is the total of all the other rows.

I want that to be fixed and not affected by any sort/filter.

var oTableNASummary = new sap.ui.table.Table("idTableNASummary",{

            columnHeaderHeight: 40,

            selectionMode: sap.ui.table.SelectionMode.None,

            width:"100%",

           visibleRowCount: 100,

            //height: "35px",

    }).addStyleClass("abcstyle");

Is it possible?

Thanks,

Seyed Ismail MAC

Accepted Solutions (1)

Accepted Solutions (1)

santhu_gowdaz
Active Contributor
0 Kudos

MAke 1st row has your table header and 2nd row as your total,

in your table declaration make fixedRowCount to 1.

var oTable = new sap.ui.table.Table({

title: "Table Example",

visibleRowCount: 7,

firstVisibleRow: 3,

fixedRowCount:1,

});

Table with fixed header and sidebar

former_member190939
Participant
0 Kudos

Hello, Thank you.



fixedRowCount:1 - I added this and it works. But it is affected with sort & filter.


Thanks.


Seyed Ismail.

Qualiture
Active Contributor
0 Kudos

...which makes total sense, since your first row is just table data, and not a strict total of the data (i.e. it is not handled any different than the other table data.

You may want to try the AnalyticalTable instead which has a dedicated 'sumOnTop' property

former_member190939
Participant
0 Kudos

That's right. Thank you Robin.

Best Regards

Seyed Ismail MAC

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi folks im facing an issue

in sap ui table

i have to select a max number of rows :  that is 19 rows ,

after that is done i have to disable select of any further rows ,

but along with that i have to enable deselect the already selected rows ,

which is not happening as of now

here is my code

    var oTable = new sap.ui.table.Table("tableid", {

    selectionMode :  sap.ui.table.SelectionMode.MultiToggle,

  // selectionBehavior: sap.ui.table.SelectionBehavior.RowSelector,

    setFixedRowCount:18,

  //navigationMode : sap.ui.table.NavigationMode.ScrollBar,

  visibleRowCount : 60,

  rowSelectionChange: function(e) {

  ////////////////////////////akshay

       var indices = e.getParameter('rowIndices');

       for (var i = 0; i < indices.length; i++) {

      

      

      

         var idx = indices[i];

         if (oTable.isIndexSelected(idx)) {

    /////////////////////////for current and previous row     

           var cxt = oTable.getContextByIndex(idx);

                

           var arr = [];

          

           arr =  oTable.getSelectedIndices();

          

          

        var selectedrowcount  = arr.length;

        var ra = parseInt(selectedrowcount);

   

         if((ra > 19) )

            {

      //  overlay_test.open();

          oTable.mProperties.selectionMode = "None" 

      

        }

      

      

  

       ////////////////////////for row count and popup      

          

         }

       }

  /////////////////////////////akshay

  }

  }

Former Member
0 Kudos

Hi Syed,

I think you can use setFixedRowCount API,if you are not looking for filtering and sorting option.

If you can do some customization, then setFirstVisibleRow  might be helpfull.

Hope this helps.

Thanks.

Sarath.