admin管理员组文章数量:1406019
I am using a sap.m.Table to display my entries. The user has the possibility to delete list items and in that case I would like to scroll to the list item which was below or above the deleted one once, the binding is updated. I do get the position of the deleted list item by calling indexOfItem but how to scroll to that position I don't know.
Any idea?
Thanks
I am using a sap.m.Table to display my entries. The user has the possibility to delete list items and in that case I would like to scroll to the list item which was below or above the deleted one once, the binding is updated. I do get the position of the deleted list item by calling indexOfItem but how to scroll to that position I don't know.
Any idea?
Thanks
Share Improve this question asked Dec 8, 2014 at 16:35 AntonSackAntonSack 1,0512 gold badges27 silver badges50 bronze badges1 Answer
Reset to default 6answer of your question should be
oList.getItems()[index].getDomRef().scrollIntoView().
but not to loose the keyboard navigation you can call
oList.getItems()[index].focus();
then browser will scroll to the item as well since m lib uses native scrolling. focus method is public for every control.
Since 1.26 you can just call oList.focus(); list remembers the last focused item for you.
something like this should work in a delete handler.
oList.attachEventOnce("updateFinished", oList.focus.bind(oList));
deleteSelectedRecordFromModel();
本文标签: javascriptsapmTable How to scroll to given listItemStack Overflow
版权声明:本文标题:javascript - sap.m.Table: How to scroll to given listItem - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744956721a2634398.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论