Get JSON value in createdRow event handler?

Get JSON value in createdRow event handler?

a_pereza_perez Posts: 2Questions: 1Answers: 0
edited March 2020 in Free community support

If the JSON object returned from the server looks like this:
{ data: (8) […], custom_param: "custom_value" }
Is it possible to get 'custom_param' value in createdRow event handler?

Normally, I could get it by doing this:
var value = table.ajax.json().custom_param;
But in createdRow event handler there is no API instance yet so I can't use this method.

Any ideas?

Answers

  • a_pereza_perez Posts: 2Questions: 1Answers: 0

    I answer myself :smile::
    createdRow: function(row, data, dataIndex) {
    var value = this.api().ajax.json().custom_param;
    ...
    }

    Hope it helps. Thanks!

This discussion has been closed.