Cannot read property of mData from calculated property
Cannot read property of mData from calculated property
I have a calculated property on an object that I'm creating like this
[code]
Object.defineProperty(batchCompleted.prototype, 'formattedStartDate', {
get: function() {
var start = this.start;
var value = moment.utc(start).format(dateTimeFormat);
return value;
}
});
[/code]
Then I'm attaching it using mData like this
[code]
{
aTargets: [5],
sTitle: 'Received',
sType: "date",
mData: 'formattedStartDate'
},
[/code]
But when I try and pull up the datagrid it tells me it can't find the column. It seems as if the culprit is in here
[code]
var aDataIn = ($.isArray(aDataSupplied)) ?
aDataSupplied.slice() :
$.extend( true, {}, aDataSupplied );
[/code]
The $.extend removes my columns from the object. Any ideas?
[code]
Object.defineProperty(batchCompleted.prototype, 'formattedStartDate', {
get: function() {
var start = this.start;
var value = moment.utc(start).format(dateTimeFormat);
return value;
}
});
[/code]
Then I'm attaching it using mData like this
[code]
{
aTargets: [5],
sTitle: 'Received',
sType: "date",
mData: 'formattedStartDate'
},
[/code]
But when I try and pull up the datagrid it tells me it can't find the column. It seems as if the culprit is in here
[code]
var aDataIn = ($.isArray(aDataSupplied)) ?
aDataSupplied.slice() :
$.extend( true, {}, aDataSupplied );
[/code]
The $.extend removes my columns from the object. Any ideas?
This discussion has been closed.