Skip to Content
0

Editable and Growing Table

Apr 05, 2017 at 09:06 AM

39

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

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

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.

Show 1 Share
10 |10000 characters needed characters left 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.

0
Akhilesh Upadhyay Apr 05, 2017 at 10:47 AM
1

are you searching for ready made code ?

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

Share
10 |10000 characters needed characters left characters exceeded