I have some Ext.js code and I want to create a function that gets a date and returns it. When I implament this code below, the dropdown list box where the dates are supposed to go shows the actual function code itself. Can anyone help?
fields: ['yearData', 'yearDisplay'],
//data: [['2012', '2012'], ['2013', '2013'], ['2014', '2014']]
data: [['2012', '2012'], ['2013', '2013'], [function () {
var d = new Date();
var n = d.getFullYear();
return n + 1;
}, function () {
var d = new Date();
var n = d.getFullYear();
return n + 1;
}]]
}),
displayField: 'yearDisplay',
In the dropdown list on the screen it shows (below) and not '2014'
function () {
var d = new Date();
var n = d.getFullYear();
return n + 1;