<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: triggering a javascript function after document library is loaded in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304860#M257990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In principal Alex is correct and the onReady event is the usual place where you can hook in your custom code. In the case of the documentLibrary some things are still loading asynchronously at the end of the onReady event (e.g. fetching the records for the dataTable, etc.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead you could wait for the renderEvent to be fired. An example of how to subscribe to this can be found at line 3155 of documentlist.js, at least in my version of Alfresco (EE 4.1.1.3):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt; // Rendering complete event handler&lt;BR /&gt;this.widgets.dataTable.subscribe("renderEvent", function DL_renderEvent() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // Do some stuff…&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2013 08:01:40 GMT</pubDate>
    <dc:creator>arnoldschrijve1</dc:creator>
    <dc:date>2013-11-12T08:01:40Z</dc:date>
    <item>
      <title>triggering a javascript function after document library is loaded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304857#M257987</link>
      <description>Hi,I want to trigger a javascript function after all the documents in the document library are loaded.I have coded a custom renderer for document library to display custom text for document library. When all the contents of the document library are loaded, I want to execute a javascript on the custo</description>
      <pubDate>Sun, 10 Nov 2013 13:36:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304857#M257987</guid>
      <dc:creator>ayubalfresco</dc:creator>
      <dc:date>2013-11-10T13:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: triggering a javascript function after document library is loaded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304858#M257988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you should not use JQuery to hook into the document library. The DOM ready event is fired before the document library is actually ready. You can use the YUI events of the document library to react to any changes or hook your custom logic into the onReady function of Alfresco.DocumentList YUI widget class. This could be done by simple prototype adjustment, i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;javascript&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (YAHOO.lang.isFunction(Alfresco.DocumentList)){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alfresco.DocumentList.prototype.normalOnReady = Alfresco.DocumentList.prototype.onReady;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Alfresco.DocumentList.prototype.onReady = function()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.normalOnReady();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/javascript&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 16:52:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304858#M257988</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2013-11-11T16:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: triggering a javascript function after document library is loaded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304859#M257989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Axel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the clue. I implemented the logic however its getting triggered before the documents are being displayed. I want to trigger the event after all the documents have been displayed. The reason is that, I am rendering a SPAN element using custom renderer and this element will only exist after each row in the document library is displayed. Any clues please ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ayub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 05:31:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304859#M257989</guid>
      <dc:creator>ayubalfresco</dc:creator>
      <dc:date>2013-11-12T05:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: triggering a javascript function after document library is loaded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304860#M257990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In principal Alex is correct and the onReady event is the usual place where you can hook in your custom code. In the case of the documentLibrary some things are still loading asynchronously at the end of the onReady event (e.g. fetching the records for the dataTable, etc.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead you could wait for the renderEvent to be fired. An example of how to subscribe to this can be found at line 3155 of documentlist.js, at least in my version of Alfresco (EE 4.1.1.3):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt; // Rendering complete event handler&lt;BR /&gt;this.widgets.dataTable.subscribe("renderEvent", function DL_renderEvent() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // Do some stuff…&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 08:01:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304860#M257990</guid>
      <dc:creator>arnoldschrijve1</dc:creator>
      <dc:date>2013-11-12T08:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: triggering a javascript function after document library is loaded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304861#M257991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to subscribe to renderEvent, however unable to get property dataTable js error from my javascript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;can I override the entire documentlist.js from extensions directory&amp;nbsp;&amp;nbsp; ? &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 18:42:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304861#M257991</guid>
      <dc:creator>ayubalfresco</dc:creator>
      <dc:date>2013-11-12T18:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: triggering a javascript function after document library is loaded</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304862#M257992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;can I override the entire documentlist.js with my new file which has the custom script from extensions directory ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2013 19:34:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/triggering-a-javascript-function-after-document-library-is/m-p/304862#M257992</guid>
      <dc:creator>ayubalfresco</dc:creator>
      <dc:date>2013-11-12T19:34:43Z</dc:date>
    </item>
  </channel>
</rss>

