Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
btpoole
Channel Surfer

Help In Getting Correct Selection on roGrid

I've never worked with screens or grid before on a channel, previous development has been on roImageCanvas.  I have got the grid to load all of my data into categories correctly.  The problem comes when I select a particular video to play. For some reason it only picks selections from Row 0. If I scroll across Row 0 and pick a video, it is correct, but if I move to say Row2 it still pricks the correct col but only from Row 0. I got the example code from the roku sdk online. Any help appreciated.
Thanks

m.port=CreateObject("roMessagePort")
screen = CreateObject("roGridScreen")
screen.SetMessagePort(m.port)
screen.SetDisplayMode("scale-to-fill")
shows=m.showlist

categoryList = getCategoryList()

screen.setupLists(categoryList.count())
screen.SetListNames(categoryList)
Print"NUMBER IN CATEGORYLIST. . ."categoryList.count()


for i = 0 to categoryList.count()-1
screen.SetContentList(i,getShowsForCategoryItem(categoryList,shows))
end for
screen.Show()  
    
  while true
         msg = wait(0, m.port)
         if type(msg) = "roGridScreenEvent" then
             if msg.isScreenClosed() then
                 return -1
             elseif msg.isListItemFocused()
                 print "Focused msg: ";msg.GetMessage();"row: ";msg.GetIndex();
                 print " col: ";msg.GetData()
             elseif msg.isListItemSelected()
                 print "Selected msg: ";msg.GetMessage();"row: ";msg.GetIndex();
                 print " col: ";msg.GetData()
                 Print"CHANNEL NAME . . . . "m.showList[msg.GetData()].title
                 playcontent(m.showList[msg.GetData()].stream)
             endif
         endif
     end while
Tags (1)
0 Kudos
1 REPLY 1
btpoole
Channel Surfer

Re: Help In Getting Correct Selection on roGrid

Please ignore the question, I had left out a line or so from the example. All working now.
Tags (1)
0 Kudos
Community is Being Upgraded!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

We're sorry for this disruption — we’re excited to share what’s next!