Arezth
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2017
07:03 PM
Access ContentNode from MarkupGrid
Hi Forum,
I am trying to access a specific item (ContentNode) from the MarkupGrid I made. I know I can acquire the number of the item I am accessing through markupgrid.itemFocused, but I was wondering how to get that specific node (selected on the grid) so I can acccess it from another .brs through a <field> on <interface>. I assume there should be a way to access through itemContent, but I haven't been able to find it.
As always, thank you for your help.
I am trying to access a specific item (ContentNode) from the MarkupGrid I made. I know I can acquire the number of the item I am accessing through markupgrid.itemFocused, but I was wondering how to get that specific node (selected on the grid) so I can acccess it from another .brs through a <field> on <interface>. I assume there should be a way to access through itemContent, but I haven't been able to find it.
As always, thank you for your help.
4 REPLIES 4
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2017
07:15 PM
Re: Access ContentNode from MarkupGrid
I'm not sure I totally understand you, but it sounds like you're describing an alias:
<interface>
<field id="specificNode" type="node" alias="markupgrid.itemFocused" />
</interface>
Arezth
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017
10:40 AM
Re: Access ContentNode from MarkupGrid
Thank you for answering belltown. I want to do something of that sort, but ".itemFocused" returns an integer. I am assigning a whole contentNode to each position on the grid, and I want to access the info of that contentNode (like .itemFocused but someway to return the content node rather than an integer), but I don't know how. With ".itemFocused" I know to which of the grid they gave click to, but how to I access the information of that node in the grid?
I hope I had make myself a bit clearer. Thank you for your help!
I hope I had make myself a bit clearer. Thank you for your help!
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017
11:27 AM
Re: Access ContentNode from MarkupGrid
I see now. You'll need two interface field aliases: one for the grid content, and one for itemFocused. Here's what I use in one of my PosterGrid elements:
Then in the code that accesses the grid you can do something like:
<interface>
<field id="content" type="node" alias="mainPosterGrid.content" />
<field id="itemFocused" type="integer" alias="mainPosterGrid.itemFocused" value="0" />
</interface>
Then in the code that accesses the grid you can do something like:
item = m.gridNode.content.GetChild(m.gridNode.itemFocused)
Arezth
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017
05:49 PM
Re: Access ContentNode from MarkupGrid
Worked perfectly belltown, thank you!!