columns.render string "FunctionName()" function notation broken

columns.render string "FunctionName()" function notation broken

infogulchinfogulch Posts: 2Questions: 2Answers: 0
edited September 2017 in Free community support

According to the documentation at columns.render (see Types > string > function notation) you should be able able to specify the name of a function in the render field followed by a pair of parens to have datatables call the named function with the data to render the field.

I have set up a jsfiddle, but it's not working: http://jsfiddle.net/jECkP/40/

Specifically I get TypeError: data[a[i]] is not a function error in the console, and nothing is rendered. I would expect it to render the data of the field by calling the named function.

The source code that corresponds with this error is in _fnGetObjectDataFn core.data.js#L286, where the specific code is:

// a is ["FunctionName"], i is 0, and data is the data of the field, e.g. "foo"
data = data[ a[i] ]();

I'm struggling trying to figure out how this ever worked in the first place, or if I misinterpreted the documentation what it is actually supposed to do.

Any ideas?

This discussion has been closed.