Skip to Content
avatar image
Former Member

Editable and Growing Table

I want to add a table with two columns and one row by default, A user have choice to add more rows accordingly and can edit any column in the table . I didn't find any suitable solution in SAPUI5 Explorer matching these requirements.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 05, 2017 at 09:36 AM

    Hi Nafees,

    You can bind a local JSON model to the table and each time you want to add a new row, just add the new entry to the items array and update the bindings. Your JSON structure should look something like this

    {
    	"Items": [{
    		"col1": "",
    		"col2": ""
    	}, {
    		"col1": "",
    		"col2": ""
    	}]
    }
    

    You can use sap.m.input as ColumnListItem to make them editable.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Yunus Salim, That could be the one solution. but I was looking, Is there any control (Example) in SAPUI5 Explorer or any other portal which describe growing table in this way.

      Otherwise I've to do as you wrote.

  • Apr 05, 2017 at 10:47 AM

    are you searching for ready made code ?

    there is no such control, its better to use logic provided by Yunus.

    Add comment
    10|10000 characters needed characters exceeded