Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
user76
Visitor

EPGGrid Itemfocused/ItemSelected

Hi -- is there a field in the EPGGrid component that references the current item focused/selected? itemFocused only gives you the row but not the actual show in the row (e.g. if you are on row 1 and you press right to move to next timeslot show, there is no way to know that...). The best thing would be a field with a reference to the actual contentNode corresponding to the item focused/selected. If not, where can I get the index of which show is being focused/selected? Thanks in advance. 
0 Kudos
2 REPLIES 2
btpoole
Channel Surfer

Re: EPGGrid Itemfocused/ItemSelected

Ran into similar situation. To make things easier make sure your data is parsed in same way grid loads the data. Locate on grid what column you are in in relation to the overall number of columns you have in the grid. You will also need to setup a call back for the grid on itemfocused to run onfocusechange . Something like
gridlocation = 0   'This needs to be set out side of onFocusChange

function onfocuschange
columnfocused= grid.itemfocused MOD grid.numColumns
If columnfocused >= gridlocation 'MOVE FORWARD
grid.jumpToItem= grid.itemFocused
gridlocation= gridlocation + 2
else if columnfocused < gridlocation and columnfocused < grid.itemUnfocused 'MOVE BACK
grid.jumpToItem= grid.itemFocused
gridlocation = gridlocation - 2
if gridlocation < 0 'CHECK TO MAKE SURE YOU DON'T MOVE OFF SCREEN
gridlocation = 0
end if
end if
end function

This is a simple version of something like I use to move across the grid. Not sure it will completely work for yours, I have some custom stuff going on in relation to this but it might get you a starting point.
0 Kudos
SECHIN_SUNNY
Visitor

Re: EPGGrid Itemfocused/ItemSelected

"user76" wrote:
Hi -- is there a field in the EPGGrid component that references the current item focused/selected? itemFocused only gives you the row but not the actual show in the row (e.g. if you are on row 1 and you press right to move to next timeslot show, there is no way to know that...). The best thing would be a field with a reference to the actual contentNode corresponding to the item focused/selected. If not, where can I get the index of which show is being focused/selected? Thanks in advance. 

May i know please where this EPGGrid component is available in roku sdk
Thanks
Regards
Sechin Sunny
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.