Adding the cellRenderer so the example and updating the docs to reflect the example changes
This commit is contained in:
@@ -25,7 +25,11 @@ export default class ColDefFactory {
|
||||
cellRenderer: countryCellRenderer, pinned: true,
|
||||
filterParams: {cellRenderer: countryCellRenderer, cellHeight: 20}}
|
||||
,
|
||||
{headerName: "DOB", field: "dob", width: 150, enableRowGroup: true, enablePivot: true, filter:'date'}
|
||||
{headerName: "DOB", field: "dob", width: 90, enableRowGroup: true, enablePivot: true, filter:'date', cellRenderer: function(params) {
|
||||
return pad(params.value.getDate(), 2) + '/' +
|
||||
pad(params.value.getMonth() + 1, 2)+ '/' +
|
||||
params.value.getFullYear();
|
||||
}}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -70,3 +74,10 @@ function countryCellRenderer(params) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//Utility function used to pad the date formatting.
|
||||
function pad(num, totalStringSize) {
|
||||
let asString = num + "";
|
||||
while (asString.length < totalStringSize) asString = "0" + asString;
|
||||
return asString;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user