Foreign key fields on accessing return 'Undefined'
Issue #83
resolved
Im having [this](https://stackoverflow.com/questions/69586490/cannot-access-the-foreignkey-data-in-datatables) which I have posted on stackoverflow where when I try to access the field of a foriegn key field, it results as Undefined. When I try to console.log the data on using
render: function(data, type, row){
console.log(row, data)
}
It gives me the str value of that table and not the particular object. Observe the 6th array index which is a string and not the object.
Array(10) [ "2021-10-16 06:25:36+00:00", "Vibula", "email@gmail.com", "9677******", "EMAESTER", "He/She is IT by profession || Looking for online teaching Job", "randomemail@gmail.com", "False", "Not Dialed", "" ]
0: "2021-10-16 06:25:36+00:00"
1: "Vibula"
2: "email@gmail.com"
3: "9677******"
4: "EMAESTER"
5: "He/She is IT by profession || Looking for online teaching Job"
6: "randomemail@gmail.com"
7: "False"
8: "Not Dialed"
9: ""
length: 10
<prototype>: Array []
randomemail@gmail.com
How do I fix this?
Comments (2)
-
reporter -
reporter - changed status to resolved
- Log in to comment
Completely missed that there is a method called render_function which does exactly what render option does in jquery.
This is what I did: