Override a method from a Primefaces specific widget

Tested with one of my tables:

PF('myTable').showCellEditor = function() {
    console.log('my function')
}

Don't forget to call the generic implementation if you need to:

PF('myTable').showCellEditor = function() {
    console.log('my function')
    // call the generic implementation:
    PrimeFaces.widget.DataTable.prototype.showCellEditor.call(this);
}

See also:

  • Calling method using JavaScript prototype
  • Intro to Primefaces widgetvar