Hi,
I have a jqxGrid that gets data in json format from remote url. One of the jqxgrid columns has a column named birthyear and I need to ADD another column in the jqxgrid that shows age (from current year).
I tried to use cellsrenderer such as below but the jqxgrid stops rendering when it hits this column. What am I doing wrong and how do fix it or is there another way to accomplish the same thing. Appreciate the help! –Douglas
{
text: 'Age',
datafield: 'age',
width: 100,
renderer: headerrenderer,
cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
var d = new Date();
var todayYear = d.getFullYear();
var rowData = $("#jqxGrid").jqxGrid('getrowdata', row);
var age = todayYear - rowData.birthYear;
return '<div style="text-align: center; margin-top: 5px;">' + age + '</div>';
}
},