Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ListView template #10

Closed
rigor789 opened this issue Apr 22, 2017 · 7 comments
Closed

Implement ListView template #10

rigor789 opened this issue Apr 22, 2017 · 7 comments

Comments

@rigor789
Copy link
Member

There is currently no way to specify item templates inside ListViews

@rigor789
Copy link
Member Author

My idea for the solution is to have a component, with a slot. Have yet to explore the details on how to tackle this, but seems like the most reasonable way to go about it!

Other concern is multiple item templates, which I don't know how will work yet.

If you have any ideas or suggestions, please write them down here! Even if it's just brainstorming, really helps with coming up with solutions.

@vjoao
Copy link

vjoao commented Apr 23, 2017

The angular renderer implements it with a detached container element for item templates:
https://github.com/NativeScript/nativescript-angular/blob/master/nativescript-angular/directives/list-view-comp.ts

@rigor789
Copy link
Member Author

If I wanted to set the itemTemplate on the ListView, what gets passed? According to the docs, it can either be a string or a Template. Is a detached container considered a template (Detached Container is a ProxyViewContainer?

(Mostly leaving these links here so it's easier to find!)

@vjoao
Copy link

vjoao commented Apr 24, 2017

@vjoao
Copy link

vjoao commented Apr 24, 2017

When you pass a String or a Template to itemTemplate, it gets passed to the builder.parse function for it to return a View.

https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/builder/builder.ts#L27

@rigor789
Copy link
Member Author

So it expects xml in that case? I think we should pass it a template instead of generating xml that will get parsed again.

@rigor789
Copy link
Member Author

rigor789 commented Apr 24, 2017

On the vue side, after a quick read through docs, I think we need to use scoped slots

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants