You can look at a grid as an array of arrays of associative arrays. Each AA looks something like this:
aa={ ContentType : "episode"
Title : "[Title" + i.toStr() + "]"
ShortDescriptionLine1 : "[ShortDescriptionLine1]"
ShortDescriptionLine2 : "[ShortDescriptionLine2]"
Description : ""
Description : "[Description] "
Rating : "NR"
StarRating : "75"
ReleaseDate : "[<mm/dd/yyyy]"
Length : 5400
Actors : []
Actors.Push("[Actor1]")
Actors.Push("[Actor2]")
Actors.Push("[Actor3]")
Director : "[Director]"
}
Each row array looks something like this:
row=[aa,aa,aa,aa,aa,aa,aa,aa,aa]
and the top level, array of arrays of associative arrays looks like this:
grid=[row
row
row
row
row
row
row]
Note that you can delimit an array with either a comma or a carriage return, so I used that method for the last one so you can visualize it.
When the user clicks on an item in the grid, the isListItemSelected() property of the roGridScreenEvent is true and the index values of that event are then available through msg.getIndex() for the horizontal position and msg.getData() for the vertical position. You can then retrieve video information from the arrays using those values:
VideoItem=grid[msg.getdata()][msg.getindex()]
or
selectedRow=grid[msg.getdata()]
selectedvideo=selectedRow[msg.getindex()]
Because you know that isListItemSelected() is true, you know that the user has clicked on an item, and now that you've extracted the video information, you just need to call your Springboard function or video playback function with selectedVideo as the parameter.
Note that it is a good practice to create your grid as an array first, and then use it to set the rows of the grid - that way you can easily rebuild the grid after you've closed it (a necessity on legacy firmware before opening another screen) without having to hit your server again and reparse the data.
Hope that helps,
- Joel