Skip to content

ListPopup

Eric edited this page Oct 9, 2024 · 17 revisions

ListPopup is a component to render extended content into a Popup from a click of an item from a DynamicList.

Create

 const listpopup = new OGX.ListPopup({
      list: _INSTANCE_OF_DYNAMIC_LIST_, 
      parent: _OPTIONAL_PARENT_UXI_,
      mode: 'auto',
      content: _CONTENT_TO_RENDER_,
      render_mode: _INT_
  });

Parent

Ignored if list is set. If set, the component is added as a child of declared parent Uxi.

Mode

Defaults to auto which handles the list selection. Set it to manual to call the open method when desired instead.

Render Modes

ListPopup offers different render modes, so you can adjust depending on the complexity of what you are rendering

 0 : The content is rendered at the same time that the Popup opens, can be laggy with complex OML
 1 : The content is rendered once the Popup has opened, while the initial DynamicList item is shrinking
 2 : The content is rendered once the Popup has opened and after the DynamicList item has shrunk

Methods

List

Get the instance of DynamicList

  const list = listpopup.list();

Set the instance of DynamicList

  listpopup.list(_DYNAMIC_LIST_INSTANCE_);

Content

Set the content as OML to be displayed

  listpopup.content(_CONTENT_);

Example

 listpopup.content({
      oml: {'default:Views.MyView':{
           template: 'MyView',
           data : {...}
      }}
 });

Open

Call this method to open the desired list element. This is only relevant in manual mode

  listpopup.open(_LIST_ITEM_, _LIST_ELEMENT_);
Clone this wiki locally