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
- All
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[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
dispatch: DispatchIt
- Definition Classes
- LazyLoad → DispatchSnippet
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- 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
template
attribute to thelazy-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 aNodeSeq
that 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
renderer
function, perhaps because you need to do further wrapping beyond whatbuildDeferredFunction
gives you, then you can invoke thisrender
method 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
renderer
function, perhaps because you need to do further wrapping beyond whatbuildDeferredFunction
gives you, then you can invoke thisrender
method 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
NodeSeq
isn'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
AsyncRenderComet
correctly.
The
renderer
function 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( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )