Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82291

Custom field type: how to get current editing row data?

$
0
0

Hi,

A figurative example of my situation: my server returns data like this: "data":[{"DT_RowId":"8666","var1":"example","var2":"example"}]

Now I have setup datatables which just shows var1 in a column. I also have setup a custom field type plugin for the Datatables Editor.

On initializing of the field type I create 2 inputs, one input where the user can enter data and the other is a read only input.

So, here`s what I want:

  • in the first input of my custom field type I want to show the value of the editing cell > this works by using the val param in the set function inside my field type plugin.
  • in the second input of my custom field type I want to show another value of the data returned by the server belonging to this row. So to take the above data as an example, I want to show var2 in the second input field.

The question is, how to retrieve this value on either initializing the field or within the set function of the field type plugin? I have been trying to get values like this this.get('var1') within the set function but it does not seem to work. It does seem to work for a few of the fields, but not for the fields I must retrieve.

I hope you understand what I`m looking for. Basically, the question I'm asking is: how to access the row data of the cell i'm editing / other cells data within the same row from my custom field type plugin?

Thanks!


Viewing all articles
Browse latest Browse all 82291

Trending Articles