Best practise with <template repeat="{{}}"> and nested custom elements

197 views
Skip to first unread message

Daniel Chin

unread,
Aug 14, 2014, 5:54:59 AM8/14/14
to polym...@googlegroups.com
Hi Guys

I am using template repeat to show a list of results which I have a input hooked up to a changed watcher that takes the value entered and performs a query which in turn manipulates a model connected to the repeating template. I have noticed that any adjustment to the data that repeating template is bound will create or remove the custom elements, Invoking the polymer-element construction stages. I would expect this behaviour to happen, My problem arises within my custom-element if I am doing work within the attached callback or so. This seems to lockup the input that is bound to the change watcher whilst its waiting for the custom-element to be done and displayed. I was wondering what are best practises for for repeating templates with custom elements nested which possibly perform tasks during creation.

Cheers

Steve Orvell

unread,
Aug 14, 2014, 4:05:42 PM8/14/14
to Daniel Chin, polym...@googlegroups.com
Here's a quick'n'dirty example of how you might do this. I've used a `core-list` element to efficiently render a very large list. The list is being filtered by an input, but typing in the input is not directly tied to updating the list. We use a computed property the calculation of which is only recomputed at most every 500ms.



Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/1ea34a54-29c7-4b87-b075-3486b9bcd41f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Chin

unread,
Aug 20, 2014, 9:22:16 AM8/20/14
to polym...@googlegroups.com, danch...@googlemail.com
Cheers Steve

I was already heading down the route of core-list, The use of a computed property was interesting and thanks for the example :) 
Reply all
Reply to author
Forward
0 new messages