Forum Discussion

user76's avatar
user76
Visitor
9 years ago

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. 

2 Replies

  • btpoole's avatar
    btpoole
    Channel Surfer
    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.
  • "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