Template:CustomItemRendering

From Documentation
Revision as of 04:01, 5 December 2023 by Hawk (talk | contribs) (→‎Custom Item Rendering)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Custom Item Rendering

Since this component has no child component like Listbox, if you want to render its items differently, there 2 ways:

Change text

If you just want to change the text e.g. enclosing it with brackets, just put <template> as its child and add characters with ${each}:

   <{{{1}}}>
       <template name="model">[${each}]</template>
   </{{{1}}}>
  • The template only allows text that can be converted into a ZK Label.

Change HTML Structure

If you want to make more changes e.g. adding tooltips by setting title attributes, you need to create your own ItemRenderer. See ZK Developer's Reference/MVC/View/Renderer/Item Renderer.