cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamically create UI5 table

saurabh_vakil
Active Contributor
0 Likes
2,987
Hi Experts,
I am having 2 table UIs in my HTML5 page. Both these tables have just 1 column each.
The purpose is to allow the user to select any row in table 1 then select a row in table 2, and show the 2 selections in a third table with 2 columns with the 2 selected values.
For eg., If first table has 1 column having values like below
Header 1
Value1
Value2
Value3
and second table has a column having values like
Header 2
Num1
Num2
Num3
then suppose user selects Value2 from first table and Num3 from second table, I want to create a third table and show the values in 2 columns like below and keep adding rows to the below table whenever user selects a combination of values from both above tables:
Header 1Header 2
Value2Num3
Can anyone please guide me how I can achieve dynamically adding rows to a table?
Regards,
Saurabh
View Entire Topic
Former Member
0 Likes

This is not working frnd

var oModel3 = new sap.ui.model.json.JSONModel();

  var rows = [{header1: tab1FieldName},{header2: tab2FieldName},

             {header3: tab3FieldName},{header4: tab4FieldName},

             {header5: tab5FieldName},{header6: tab6FieldName},

             {header7: tab7FieldName},{header8: tab8FieldName},

             {header9: tab9FieldName}];

            currentData = oModel3.getData();

            if(currentData.modelData){

                      rows = currentData.modelData.concat(rows);

            }

          

  oModel3.setData({modelData: rows});

  oTable3.setModel(oModel3);

  oTable3.bindRows("/modelData");

  oTable3.placeAt("dataTable");

  });

Their is same problem even after putting this Code