dlsso dlsso - 1 year ago 84
Javascript Question

How to know when iron-list is finished creating html


I am creating a a polymer iron-list and populating the list by setting the
property directly, like so:
document.getElementById('itemsList').items = data;

When user changes category I change value of
in the above manner (retrieved with ajax). This works perfectly, but I now need to change the options in a
depending on my list category. I was able to do this using templating but it's cumbersome and may not even work later when the options need to be dynamic.

I would like to simply hide certain options with JavaScript but the
I want to manipulate is not present immediately after doing
.items = data
. I need a callback or some other way to detect when
is done inserting HTML.


I looked through the documentation and couldn't find any references to callbacks or events other than
, and that doesn't look helpful.

I could potentially figure it out by listening
events but that's probably worse than the solution I've already got.

would also work, but is also a bad solution.

From miyamoto: I could check
on iron-list which gets set to true, but I would probably need to do
to check, also bad.


Is there a callback of any sort to let me know when
is finished creating HTML? Failing that maybe an event or something else I could use to know when it's done?

Answer Source

We are currently trying to go a different route, but if anyone else needs to accomplish this it looks like the dom-change event should tell you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download