Biglistbox Template"
From Documentation
Wenninghsu (talk | contribs) |
Wenninghsu (talk | contribs) |
||
Line 8: | Line 8: | ||
<template name="heads"> | <template name="heads"> | ||
<html><![CDATA[ | <html><![CDATA[ | ||
− | <div class="images_${matrixInfo[0] | + | <div class="images_${matrixInfo[0]}" title="x=${matrixInfo[0]},y=${matrixInfo[1]}">${each[matrixInfo[0]]}</div> |
]]></html> | ]]></html> | ||
</template> | </template> | ||
<template name="rows"> | <template name="rows"> | ||
<html><![CDATA[ | <html><![CDATA[ | ||
− | <div class="images_${matrixInfo[0] | + | <div class="images_${matrixInfo[0]}" title="x=${matrixInfo[0]},y=${matrixInfo[1]}">${each[matrixInfo[0]]}</div> |
]]></html> | ]]></html> | ||
</template> | </template> |
Revision as of 03:19, 13 January 2017
Similar to Listbox, you can render a biglistbox with a template. However, notice that, unlike other components, biglistbox doesn't allow any child component, so you have to render each item as a string. For example,
<biglistbox hflex="1" vflex="1" model="${data}" >
<!-- Template example -->
<template name="heads">
<html><![CDATA[
<div class="images_${matrixInfo[0]}" title="x=${matrixInfo[0]},y=${matrixInfo[1]}">${each[matrixInfo[0]]}</div>
]]></html>
</template>
<template name="rows">
<html><![CDATA[
<div class="images_${matrixInfo[0]}" title="x=${matrixInfo[0]},y=${matrixInfo[1]}">${each[matrixInfo[0]]}</div>
]]></html>
</template>
</biglistbox>
As you can see, we utilize two attributes - rowIndex & colIndex from the matrixInfo object to receive the current index during template rendering phase.
where we assume there is a matrix model (FakerMatrixModel) called data such as:
FakerMatrixModel model = new FakerMatrixModel(100, 100);
Version History
Version | Date | Content |
---|---|---|
6.0.1 | March 2012 | The biglistbox component was introduced. |