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.
- Alphabetic
- By Inheritance
- LazyLoad
- DispatchSnippet
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type DispatchIt = PartialFunction[String, (NodeSeq) => NodeSeq]
- Definition Classes
- DispatchSnippet
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def dispatch: DispatchIt
- Definition Classes
- LazyLoad → DispatchSnippet
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def render(xhtml: NodeSeq): NodeSeq
- def render(xhtml: NodeSeq, placeholderTemplate: Box[NodeSeq]): NodeSeq
Enclose your snippet like this:
Enclose your snippet like this:
You can also add the
templateattribute to thelazy-loadsnippet 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
placeholderTemplatethat is aNodeSeqthat should be used while the async rendering takes place. - def render(renderer: (String) => JsCmd, placeholderTemplate: Box[NodeSeq] = Empty): NodeSeq
If you need to provide a custom
rendererfunction, perhaps because you need to do further wrapping beyond whatbuildDeferredFunctiongives you, then you can invoke thisrendermethod directly and pass it a function that will take the id of the placeholder container and render whatever needs to be rendered to aJsCmd.If you need to provide a custom
rendererfunction, perhaps because you need to do further wrapping beyond whatbuildDeferredFunctiongives you, then you can invoke thisrendermethod directly and pass it a function that will take the id of the placeholder container and render whatever needs to be rendered to aJsCmd. The snippet will:- Set up the placeholder markup with a unique id.
- If the placeholder template
NodeSeqisn't specified, first see ifS.attr("template")is set and use that template if avilable, and then fall back on the default placeholder template. - Handle invoking the
AsyncRenderCometcorrectly.
The
rendererfunction will be wrapped in current request state you must do this manually usingbuildDeferredFunction. This method is for advanced use; most folks will probably want to interact with the snippet by just wrapping their snippet invocation in adata-lift="lazy-load"snippet. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()