imagelist
A list of items with an image in addition to titles and subtitles.
Syntax
<div data-juci="imagelist" data-bind="ref: imgs" data-img="img" data-title="title" onlistitemclick="$m.toast('U clicked - '+ event.data.title);"></div>
juci.addDataset("imgs", [
{img: "image1.png", "title":"First item"},
{img: "image2.png", "title":"Second item"}
]);
Attributes
-
data-img {String} ¶Name of reference or an expression with the reference, defined using juci#addDataset. Appears as an image in each item.
-
data-img-onerror {String} ¶Name of function defined on the window scope. Added as a listener for catalog#event:imageerror.
-
data-img-onload {String} ¶Name of function defined on the window scope. Added as a listener for catalog#event:imageload.
-
data-img-css {String} ¶CSS class for the image. See css expression binding
-
data-juci {String} ¶A string with value imagelist.
Methods
-
onImageClick(handler, context) ¶Registers a handler function to call when the imagelist#event:imageclick event fires.Parameters:
-
handler{Function}
A handler function to execute when the event fires.
-
context{Object}
Optional
Context in which the handler function should execute.
- See:
- imageclick
-
handler{Function}
Events
-
imageclick(eventObj) ¶Fires when user taps on the image in an imagelist item.Parameters:
-
eventObj{EventObject}
-
data{Object}
Data for the item.
-
listItem{juci.elem}
The element for the item.
-
index{Number}
Index of the item.
-
wrappedData{Object}
The mapped data for the item.
-
data{Object}
-
eventObj{EventObject}
-
imageerror(eventObj) ¶Fires when an image in a list item has finished loading with errors.Parameters:
-
eventObj{EventObject}
-
data{Object}
The item.
-
listItem{juci.elem}
The element for the item.
-
data{Object}
This event cannot be listened to in html through onimageerror. Use data-img-on-error. -
eventObj{EventObject}
-
imageload(eventObj) ¶Fires when an image in a list item has finished loading.Parameters:
-
eventObj{EventObject}
-
data{Object}
The item.
-
listItem{juci.elem}
The element for the item.
-
data{Object}
This event cannot be listened to in html through onimageload. Use data-img-on-load. -
eventObj{EventObject}