'How to add logic in columnDefs of ui-grid?
I am using ui-grid for one AngularJS project. While defining the columnDefs for that particular grid, I need to set header name dynamically, e.g. I've one value stored in session storage or in grid's parent $scope, based on that value I need different header names.
Refer to example below:
{
name: 'UHID',
displayName: JSON.parse(sessionStorage.appConfig).isRegistrationLabelForMalayasianClient ? 'reg.mrNo' : 'reg.uhid',
enableSorting: true,
enableCellEdit: false,
headerCellFilter: "translate",
// pinnedLeft: true,
width: 120,
cellTooltip: function(row, col) {
return row.entity.UHID
}
}
but this is throwing error as the grid definition is not injected.
Please help with your valuable solutions or ideas.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
