Class/Object

org.querki.gadgets.components

RxDiv

Related Docs: object RxDiv | package components

Permalink

case class RxDiv(rxGuts: Rx[Seq[Gadget[_]]], base: scalatags.JsDom.all.Modifier*)(implicit ctx: Owner) extends Gadget[HTMLDivElement] with Product with Serializable

A div whose contents can be updated reactively.

TODO: the way that renderedDiv works here really ought to replace the rendered method in ManagedFrag. Indeed, I really should re-examine the way things work in this light, noting the relationship between doRender() and obs below.

Linear Supertypes
Serializable, Serializable, Product, Equals, core.Gadget[HTMLDivElement], core.ManagedFrag[HTMLDivElement], Frag, Frag[Element, Node], Modifier[Element], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RxDiv
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Gadget
  7. ManagedFrag
  8. Frag
  9. Frag
  10. Modifier
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RxDiv(rxGuts: Rx[Seq[Gadget[_]]], base: scalatags.JsDom.all.Modifier*)(implicit ctx: Owner)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def applyTo(parent: Element): Unit

    Permalink

    We intercept applyTo() (which is part of Scalatags), to record the parent of this Node.

    We intercept applyTo() (which is part of Scalatags), to record the parent of this Node.

    Definition Classes
    ManagedFrag → Frag → Modifier
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val base: scalatags.JsDom.all.Modifier*

    Permalink
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def createFrag: HTMLDivElement

    Permalink

    Concrete classes must define this.

    Concrete classes must define this. It causes the actual DOM node to come into existence.

    Definition Classes
    GadgetManagedFrag
  9. lazy val divRx: Dynamic[HTMLDivElement]

    Permalink
  10. lazy val divTag: Dynamic[TypedTag[Div]]

    Permalink
  11. def doRender(): core.Gadget[Div]

    Permalink

    Concrete subclasses should fill this in with the actual guts of the Gadget.

    Concrete subclasses should fill this in with the actual guts of the Gadget.

    Note that this can be filled with a conventional Scalatags TypedTag thanks to an implicit conversion in globals.

    Definition Classes
    RxDivGadget
  12. def elem: HTMLDivElement

    Permalink

    Fetches the actual rendered DOM Node for this Frag.

    Fetches the actual rendered DOM Node for this Frag.

    IMPORTANT: this is convenient, but fundamentally unsafe! Only use it in places where you are *certain* that the Node has already been rendered; otherwise, use the safer elemOpt or elemOptRx!

    Definition Classes
    ManagedFrag
  13. def elemOpt: Option[HTMLDivElement]

    Permalink
    Definition Classes
    ManagedFrag
  14. val elemOptRx: Var[Option[HTMLDivElement]]

    Permalink

    An Rx member containing the actual Node iff it has been rendered.

    An Rx member containing the actual Node iff it has been rendered.

    Definition Classes
    ManagedFrag
  15. lazy val elemRx: Var[Option[Element]]

    Permalink

    Listeners can pay attention to changes to this, if they want to fire after updates:

  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def mapElementOrElse[R](default: R, f: (Element) ⇒ R): R

    Permalink

    Convenience function for operating on the Element, if this Gadget has been rendered.

    Convenience function for operating on the Element, if this Gadget has been rendered.

    Yes, this deliberately squashes Output to Element for purposes of the function call. That is typically good enough, and is kinder to the sQuery type inference.

    TBD: this suggests that sQuery should be smarter about Element subclasses.

    Definition Classes
    Gadget
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. lazy val obs: Obs

    Permalink
  25. def onCreate(e: HTMLDivElement): Unit

    Permalink

    Concrete Gadgets can override this to perform actions after we've created the actual Element.

    Concrete Gadgets can override this to perform actions after we've created the actual Element.

    Definition Classes
    RxDivGadget
  26. def onInserted(): Unit

    Permalink

    This is called immediately after this fragment is inserted into its parent, so that you can provide additional stuff that happens then.

    This is called immediately after this fragment is inserted into its parent, so that you can provide additional stuff that happens then.

    Definition Classes
    ManagedFrag
  27. def onRendered(e: HTMLDivElement): Unit

    Permalink

    Subclasses can override this to define behaviour that happens in the middle of the render function.

    Subclasses can override this to define behaviour that happens in the middle of the render function. Generally used by infrastructure, not concrete classes.

    Definition Classes
    GadgetManagedFrag
  28. def parentOpt: Option[Element]

    Permalink
    Definition Classes
    ManagedFrag
  29. val parentOptRx: Var[Option[Element]]

    Permalink

    The parent of the resulting Node, once it has been created.

    The parent of the resulting Node, once it has been created.

    Definition Classes
    ManagedFrag
  30. def render: HTMLDivElement

    Permalink

    We intercept render (which is part of Scalatags), to record the Node when it gets created, and to provide access to the creation event.

    We intercept render (which is part of Scalatags), to record the Node when it gets created, and to provide access to the creation event.

    IMPORTANT: this imperatively renders the Gadget; if you call it repeatedly, it will render again! Use rendered by preference most of the time.

    Definition Classes
    ManagedFrag → Frag → Frag
  31. def rendered: HTMLDivElement

    Permalink

    Lazy version of render().

    Lazy version of render(). This returns the rendered content of the Gadget, rendering if need be. This allows you to easily fetch the elem repeatedly, without worrying about re-rendering.

    Definition Classes
    ManagedFrag
  32. val rxGuts: Rx[Seq[Gadget[_]]]

    Permalink
  33. def setElem(e: HTMLDivElement): RxDiv.this.type

    Permalink

    Slam the element for this Gadget.

    Slam the element for this Gadget. You should only call this iff the element was created from an external mechanism and you're building this Gadget around that element.

    This is intentionally designed for chaining, for ease of use -- it returns this Gadget.

    Definition Classes
    ManagedFrag
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def underlyingTag: core.ManagedFrag[HTMLDivElement]

    Permalink
    Definition Classes
    Gadget
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from core.Gadget[HTMLDivElement]

Inherited from core.ManagedFrag[HTMLDivElement]

Inherited from Frag

Inherited from Frag[Element, Node]

Inherited from Modifier[Element]

Inherited from AnyRef

Inherited from Any

Ungrouped