How to implement and call custom formatters?

How to implement and call custom formatters?

hexadechexadec Posts: 1Questions: 1Answers: 0
edited April 2018 in Free community support

Hi,
I'm new to web dev. but have been an embedded C programmer for years.
I'm trying to add a formatter function to Format.php and came across this thread:
https://datatables.net/forums/discussion/20716

This is exactly what I want but I just get errors however I try to pass the Field instance to the Format class methods.
Using the above code (which Allan says was a good way of doing it!) this is the error shown in Chrome debugger:

<b>Warning</b>:  call_user_func() expects parameter 1 to be a valid callback, class 'DataTables\Editor\Format' does not have a method 'CapitaliseFirstLetterLegacy' in <b>/var/www/clients/client10/web13/web/php/lib/Editor/Field.php</b> on line <b>767</b><br />
<br />
<b>Fatal error</b>:  Uncaught Error: Function name must be a string in /var/www/clients/client10/web13/web/php/lib/Editor/Field.php:769

I can't find an example of extending the class methods or indeed how to call them from an editor instance.
Can anyone point me in the right direction?

Apart from my lack of knowledge the Editor is working great and well worth the money invested! :smile:

Cheers, Roy

This discussion has been closed.