Skip to main content

RemoteSubtree

Type nameSupports Property AnimationsControlled by defaultMay contain associated actionLink
RemoteSubtree✗✔️✗-

The RemoteSubtree widget is an analogue of the Subtree widget and has a similar content update mechanics. But the difference between RemoteSubtree and Subtree is that RemoteSubtree is able to independently initiate a request for its own content from the server and render it.

The RemoteSubtree widget solves the following problems:

  • Ability to dynamically load content in cases where you don't want a new widget subtree to be passed from the server as part of an event
  • Reducing the size of the initial json layout. For example, when you don't want to include BottomSheet content in the initial layout.

In widget attributes you can pass:

  • URL for loading widget content
  • Request meta-information (usually this is the http request method)
  • List of dependencies for forming the request body similar to actions

Usage​

RemoteSubtree(
&duit_attributes.RemoteSubtreeAttributes{
DownloadPath: "/some/url/to/download/layout",
Meta: map[string]interface{}{
"method": "POST",
},
Dependencies: []*duit_core.ActionDependency{
{
Id: "some_id",
Target: "some_target",
},
},
},
"id",
)