Your Digital Media Has Never Looked So Good

 
Arezth
Topic Author
Posts: 19
Joined: Fri Mar 10, 2017 5:00 pm

Access ContentNode from MarkupGrid

Tue Apr 11, 2017 7:03 pm

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.
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Access ContentNode from MarkupGrid

Tue Apr 11, 2017 7:15 pm

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>
https://github.com/belltown/
 
Arezth
Topic Author
Posts: 19
Joined: Fri Mar 10, 2017 5:00 pm

Re: Access ContentNode from MarkupGrid

Wed Apr 12, 2017 10:40 am

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!
 
belltown
Posts: 1465
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Access ContentNode from MarkupGrid

Wed Apr 12, 2017 11:27 am

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:
<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)
https://github.com/belltown/
 
Arezth
Topic Author
Posts: 19
Joined: Fri Mar 10, 2017 5:00 pm

Re: Access ContentNode from MarkupGrid

Wed Apr 12, 2017 5:49 pm

Worked perfectly belltown, thank you!!

Who is online

Users browsing this forum: No registered users and 6 guests