Kite Publisher: Button does not render on dynamically added HTML

eazyequity
We have a infinite scroll page where new script tiles ( HTML) are appended to the document as user scrolls down the page. The Kite button as given in the sample does not render on the dynamically added HTML tiles. It works fine on the initial set of tiles that get rendered as part of page load.

Looks like the publisher JS does not attach to the dynamically added elements to the page and attaches only to the item available initially on document.ready. What is the fix/workaround to get past it?
  • Kailash
    We're investigating this.
  • eazyequity
    Do you have any update on this.
  • Kailash
    We're rolling out a patch today that fixes this. Thanks for your patience.
  • Kailash
    The issue should be resolved now. Please clear your cache and retry.
  • eazyequity
    Thanks, I just verified it and it still does not work. Cache has been cleared before it was retried. Please check http://ww2.eazyequity.com/, we have published the update though it is not working. Scroll down post 12th tile to see the issue.
  • Kailash
    That's quite strange. I was trying to inspect events attached to elements on your page using the Chrome inspector, but it shows no events whatsoever, which is strange.

    Here's a test page that replicates your page's functionality -- https://kite.trade/test.html.

    There's a button by default, then a new button is appended dynamically using jQuery.append() every second, and you can see that the buttons work. There must be some JS on your page that is causing the Publisher JS (and the Chrome event inspector) to malfunction. Can you test the buttons in isolation from the bulk of the JS you have?
  • eazyequity
    Well, its a simple HTML append that we use ( not in jQuery though). Please note that the buttons which does not render does not have the kite-buy class applied. The same page works if all tiles are loaded on page load, see an example @ http://ww2.eazyequity.com/Home/TopGainers
  • Vivek
    Your script's using jQuery to append the HTML and not the DOM methods directly. From your page:
    $('.resultgrid').append(data);

    The test page we setup uses the same routine to keep appending buttons. There must be something on your page that's interfering with the library. It'd be great if you could try to test this in isolation.
Sign In or Register to comment.