Problem with mData and access fields in datatables
Problem with mData and access fields in datatables
cybereddie
Posts: 8Questions: 1Answers: 0
http://postimg.org/image/5yt502oen/
The bellow line works perfectly on my datatables.
{ "aTargets":["Schedule2"], "mData":"Schedules__r.2.Quantity__c", sClass:"Schedule2", "bAutoWidth": true},
My question is how do I add Schedules__r.2.Date__c to this line [like joining strings?].
I have tried to create a function [you can check the included image], But it doesnt work.
Any ideas?
This discussion has been closed.
Replies
Use
columns.render
to do this.Allan
I was reading the documentation ans was thinking that mRender might work too. What do you think? Can you give me an example on how it could work? Appreciated. I have spent already too much time on this trying to figure out the parameters.
There is an example of using mRender on the page you have linked to.
columns.render
is the new name for the legacy mRender option. As tangerine notes there are examples in the documentation. It should be as simple as:Allan
I think its something I am missing on the dot notations.
This one works.
{ "aTargets":["Schedule1"], "mData":"Schedules__r.1.Quantity__c",
"mRender": function(data, type, row){
var data3 = row.Account.Name;
var data2 = data + " - "+data3;
return data2;
}
This one doesn't!
{ "aTargets":["Schedule1"], "mData":"Schedules__r.1.Quantity__c",
"mRender": function(data, type, row){
var data3 = row.Schedules__r.1.Quantity__c;
var data2 = data + " - "+data3;
return data2;
}
This one doesn't! too
{ "aTargets":["Schedule1"], "mData":"Schedules__r.1.Quantity__c",
"mRender": function(data, type, row){
var data3 = row.Schedules__r.1.Date__c;
var data2 = data + " - "+data3;
return data2;
}
i found it. This one works.
Thank you guys!!