Skip to Content
0

Based on the search ,Focus on non-input field in the table

Jun 06, 2017 at 07:23 PM

108

avatar image
Former Member

Hi Team,

We have a requirement to search for string in one column and set focus on the input field (say cell 4 of the matching row) in other column of sap.m.table.

Based on the matching string index of the row , able to set focus on the input field cell.

that.byId(otable.getItems()[i].getAggregation("cells")[4].getId()).focus(); - This is working

When the input field column is disabled for input and its in display mode , even then search need to work same as above either by highlighting the row or the cell .

In sap.ui.table , we have method setFirstVisibleRow - with this we can make row as first either in input or display mode.

Is there any way we can achieve this with sap.m.table ?

Regards

Madhu

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 Jun 07, 2017 at 10:00 PM
0

Thanks for the info Akhilesh.

Able to fix it with CSS and with below code.

that.byId(otable.getItems()[i].getAggregation("cells")[1].getId()).addStyleClass('highlightcell');
j = i - 1; 
var vScroll = that.byId(otable.getItems()[j].getAggregation("cells")[1].getId()).$();
vScroll.get(0).scrollIntoView();


Regards

Madhu

Share
10 |10000 characters needed characters left characters exceeded
Akhilesh Upadhyay Jun 07, 2017 at 07:11 AM
0

offcourse in case of disabled state .focus wont work, in that case, apply some css rather than focus.

in case of row position change, you can modify the data and rebind the table I guess.

Share
10 |10000 characters needed characters left characters exceeded