Nativescript: [Feature Request] Support multiple item templates within Repeater

Created on 13 Mar 2017  路  5Comments  路  Source: NativeScript/NativeScript

As far as I can tell, we can not use templates within the Repeater control.

In an ideal world this would work exactly like the ListView itemTemplateSelector.

<Repeater items="{{ items }}" itemTemplateSelector="SOME EXPRESSION">
  <Repeater.itemTemplates>

    <template key="template-one">
      <!-- LAYOUT 1 -->
    </template>

    <template key="template-two">
      <!-- LAYOUT 2 -->
    </template>

  </Repeater.itemTemplates>
</Repeater>


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

feature good first issue hacktoberfest medium

Most helpful comment

any news for this feature ?

All 5 comments

Hey @3rror404, as this functionality is already available for ListView, isn't that option applicable for you?

Hi @NickIliev,
Yes and no. There are some issues with the list view that don't exist with the repeater.
It's not possible to set the ListView's height to automatically fit it's items without writing platform specific code. This can be especially difficult when each item is of different height.
The list view also has a built in scrolling behaviour, tap highlighting, cell dividers, all of which are not desired sometimes.

Having a basic repeater with a more complex templating system would make life easier for me.

any news for this feature ?

Need this too. I need this feature within Repeater, because there are no ability to turn of scrolling of ListView.

It would be great if this feature got implemented. It's solving so many problems.

Was this page helpful?
0 / 5 - 0 ratings