SetCurrentParent()

Pushes the current parent onto the stack and sets a new parent element. This allows you to manually control the parent hierarchy.

Syntax
Result = MaterialSB::SetCurrentParent(Parent)
Parameters
Parameter Description
Parent The DOM element to set as the new current parent.
Return Value

Returns the new current parent element (same as the input).

Remarks

Unlike container functions like Row() and Col() which automatically manage the parent stack, SetCurrentParent() gives you manual control. This is useful when you need to:

Since this function pushes to the stack, remember to call CloseCurrentParent() when done.

Example
; Create a card and store reference
MaterialSB::Row()
  myCard = MaterialSB::Card()
    MaterialSB::CardContent()
      MaterialSB::Append(MaterialSB::Paragraph("Initial content"))
    MaterialSB::CloseCurrentParent()
  MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()

; Later, add more content to the card
MaterialSB::SetCurrentParent(myCard)
  MaterialSB::CardAction()
    MaterialSB::Append(MaterialSB::Link("Learn More", @LearnMoreCallback()))
  MaterialSB::CloseCurrentParent()
MaterialSB::CloseCurrentParent()
See Also

GetCurrentParent(), CloseCurrentParent()