object LazyLoad extends DispatchSnippet

Enclose your snippet tags on your template with LazyLoad and the snippet will execute on a different thread, which avoids blocking the page render.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LazyLoad
  2. DispatchSnippet
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type DispatchIt = PartialFunction[String, (NodeSeq) ⇒ NodeSeq]
    Definition Classes
    DispatchSnippet

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def dispatch: DispatchIt
    Definition Classes
    LazyLoadDispatchSnippet
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  16. def render(xhtml: NodeSeq): NodeSeq
  17. def render(xhtml: NodeSeq, placeholderTemplate: Box[NodeSeq]): NodeSeq

    Enclose your snippet like this:

    Enclose your snippet like this:

    You can also add the template attribute to the lazy-load snippet to specify what to render as a placeholder:

    Note that this must be a single element that will be replaced when the lazy content is loaded. By default, an AJAX spinner is displayed inside a div.

    If you invoke this from Scala rather than markup, you can optionally provide a placeholderTemplate that is a NodeSeq that should be used while the async rendering takes place.

  18. def render(renderer: (String) ⇒ JsCmd, placeholderTemplate: Box[NodeSeq] = Empty): NodeSeq

    If you need to provide a custom renderer function, perhaps because you need to do further wrapping beyond what buildDeferredFunction gives you, then you can invoke this render method directly and pass it a function that will take the id of the placeholder container and render whatever needs to be rendered to a JsCmd.

    If you need to provide a custom renderer function, perhaps because you need to do further wrapping beyond what buildDeferredFunction gives you, then you can invoke this render method directly and pass it a function that will take the id of the placeholder container and render whatever needs to be rendered to a JsCmd. The snippet will:

    • Set up the placeholder markup with a unique id.
    • If the placeholder template NodeSeq isn't specified, first see if S.attr("template") is set and use that template if avilable, and then fall back on the default placeholder template.
    • Handle invoking the AsyncRenderComet correctly.

    The renderer function will be wrapped in current request state you must do this manually using buildDeferredFunction. This method is for advanced use; most folks will probably want to interact with the snippet by just wrapping their snippet invocation in a data-lift="lazy-load" snippet.

  19. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DispatchSnippet

Inherited from AnyRef

Inherited from Any

Ungrouped