<field id="itemContent" type="node" onChange="itemContentChanged" />
function refreshGrid()
m.myMarkupGrid = m.top.findNode("myMarkupGrid")
m.myMarkupGrid.content= m.global.posterx.shows
m.myMarkupGrid.SetFocus(true)
end function
function refreshGrid()
newMarkupGrid = CreateObject("myMarkupGrid")
newMarkupGrid.content= m.global.posterx.shows
' skipping the step here of assigning to a field that the parent observes, pseudo code'
m.parent.replaceChild(newMarkupgrid, index)
end function
"joetesta" wrote:
I think the proper way to do this is to create a new markupgrid node and replace the existing node from above, by assigning the new node to an observed node field that the parent will see and "replacechild" with the new node.
maybe something likefunction refreshGrid()
newMarkupGrid = CreateObject("myMarkupGrid")
newMarkupGrid.content= m.global.posterx.shows
' skipping the step here of assigning to a field that the parent observes, pseudo code'
m.parent.replaceChild(newMarkupgrid, index)
end function
you'll need to first find and set the right m.parent and index values for this to work.
for i = 0 to m.top.getChildCount()-1
child = m.top.getChild(i)
if child.id = "myMarkupGrid"
index = i
exit for
end if
end for
mewMarkupGrid.id = "myMarkupGrid"
m.top.replaceChild(newMarkupGrid,index)
m.parent.replaceChild(newMarkupgrid, index)
"joetesta" wrote:
"Now, I am not sure how to get the parent or index."
hmm in this case the markupgrid is a child of m.top, so you need to find the child index position under m.top;
for i = 0 to m.top.getChildCount()-1
child = m.top.getChild(i)
if child.id = "myMarkupGrid"
index = i
exit for
end if
end for
mewMarkupGrid.id = "myMarkupGrid"
m.top.replaceChild(newMarkupGrid,index)
that would all go instead of this line,m.parent.replaceChild(newMarkupgrid, index)
"btpoole" wrote:"joetesta" wrote:
"Now, I am not sure how to get the parent or index."
hmm in this case the markupgrid is a child of m.top, so you need to find the child index position under m.top;
for i = 0 to m.top.getChildCount()-1
child = m.top.getChild(i)
if child.id = "myMarkupGrid"
index = i
exit for
end if
end for
mewMarkupGrid.id = "myMarkupGrid"
m.top.replaceChild(newMarkupGrid,index)
that would all go instead of this line,m.parent.replaceChild(newMarkupgrid, index)
Thanks again joetesta, this example along with your previous info helped greatly. I would think there would have been a way to refresh, update or redraw, would have never thought you would have to replace one node with another. I guess as long as it work. Thanks a million.
"btpoole" wrote:"btpoole" wrote:"joetesta" wrote:
"Now, I am not sure how to get the parent or index."
hmm in this case the markupgrid is a child of m.top, so you need to find the child index position under m.top;
for i = 0 to m.top.getChildCount()-1
child = m.top.getChild(i)
if child.id = "myMarkupGrid"
index = i
exit for
end if
end for
mewMarkupGrid.id = "myMarkupGrid"
m.top.replaceChild(newMarkupGrid,index)
that would all go instead of this line,m.parent.replaceChild(newMarkupgrid, index)
Thanks again joetesta, this example along with your previous info helped greatly. I would think there would have been a way to refresh, update or redraw, would have never thought you would have to replace one node with another. I guess as long as it work. Thanks a million.
"joetesta" wrote:
that's really strange, doesn't seem like we're replacing the wrong index. Any chance that second grid is a child of the first?
newmarkupGrid= createobject("myMarkupGrid")
newmarkupGrid= myMarkupGrid