lock_4815162342
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017
12:16 PM
Set focus of grid (SimpleGridWithDetailsAndVideo)
How do you set the focus on a grid? :?:
I am trying to learn ScreenGraph and I am using the SimpleGridWithDetailsAndVideo sample project. I have modified the app to display a second grid screen when selecting an item from the first grid screen. I want to be able to load the second grid screen with the correct item selected but the index is always [0,0].
I have tried setting the field "itemFocused" for the second grid. This causes the description, title and background image to display at the top of the screen for the item that I set. However, the first item is always focused (blue highlight box around it) despite setting the itemFocused.
I also tried setting rowItemSelected but this triggers the selection listener and causes all kinds of issues. Besides I just want to focus the item not select it. :roll:
Where do I set the index of where I want the focus to be on the grid? Am I misunderstanding something? :?:
Thank you very much for taking the time to read this. Any information that you can offer will be very appreciated. 🙂
I am trying to learn ScreenGraph and I am using the SimpleGridWithDetailsAndVideo sample project. I have modified the app to display a second grid screen when selecting an item from the first grid screen. I want to be able to load the second grid screen with the correct item selected but the index is always [0,0].
I have tried setting the field "itemFocused" for the second grid. This causes the description, title and background image to display at the top of the screen for the item that I set. However, the first item is always focused (blue highlight box around it) despite setting the itemFocused.
I also tried setting rowItemSelected but this triggers the selection listener and causes all kinds of issues. Besides I just want to focus the item not select it. :roll:
Where do I set the index of where I want the focus to be on the grid? Am I misunderstanding something? :?:
Thank you very much for taking the time to read this. Any information that you can offer will be very appreciated. 🙂
1 REPLY 1
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2017
08:21 AM
Re: Set focus of grid (SimpleGridWithDetailsAndVideo)
itemFocused is Read only which means you won't be able to set it.
I think what you want to do is to use "jumpToItem" Assuming the 2nd grid focus should be on the same item as the current first grid focus, it would be something like:
I think what you want to do is to use "jumpToItem" Assuming the 2nd grid focus should be on the same item as the current first grid focus, it would be something like:
currentItemFocus = grid1.itemFocused
grid2.jumpToItem(currentItemFocus)
aspiring