Override a method from a Primefaces specific widget
<p>I want to overwrite a function of Primefaces datatable component. According to this question: <a href="https://stackoverflow.com/questions/27551493/how-do-i-find-and-or-override-javascript-in-primefaces-component-based-on-widget">How do I find and/or override JavaScript in Primefaces component based on widgetVar?</a> it is possible by using <code>PrimeFaces.widget.DataTable.prototype.</code>. But I want to override this function for one datatable only, not for all.</p>

<p>This does not work:</p>

<pre><code>&lt;p:dataTable widgetVar="myTable" ...&gt;
&lt;/p:dataTable&gt;
....
&lt;script type="text/javascript"&gt;
       $(document).ready(function(){
           if (PF('myTable') !== undefined) {
                PF('myTable').jq.datatable({
                     showCellEditor: function (c) {
                         console.log('my function');
                     }
                 });
            }
         });
&lt;/script&gt;
</code></pre>

<p>Is this how it is supposed to be done or am I completely wrong?</p>