(plnkr link ,
) but , the function (grid.appScope.letter()) is being called for infinite number of times . I have raised the issue but didn't got any reply .. , . Can anyone please suggest the best possible way to achieve the above mentioned task.
I want to add some custom field in columnDefs and want to access it from header template.
As an example , i want a field let say showFile
$scope.gridOptions.columnDefs = [
{
name: 'ServiceID',
displayName: 'Service',
showFile: some data
}]
and want to access showFile inside header template ...
(plnkr link http://plnkr.co/edit/ZW43LsiLY7GdnX6XEOgG?p=preview ,
http://plnkr.co/edit/3E8HTz4Z2daGqRh1WHtx?p=preview) but , the function (grid.appScope.letter()) is being called for infinite number of times . I have raised the issue but didn't got any reply .. https://github./angular-ui/ui-grid/issues/4250 , https://github./angular-ui/ui-grid/issues/4314. Can anyone please suggest the best possible way to achieve the above mentioned task.
javascript
angularjs
angular-ui-grid
Share
edited Dec 14, 2016 at 10:58surya singh
asked Sep 22, 2015 at 16:42
surya singhsurya singh27766 silver badges2323 bronze badges
Add a ment
|
3 Answers
3
Reset to default
1
Try using renderIndex. This will give you the column's index.
I edited the plnkr: http://plnkr.co/edit/kdU59pZYQT0B76vYBQC8?p=preview.
I'm not sure if that's what you want to do, i used the headerCellTemplate in the columnDefs object instead of the headerTemplate, then you access with: {{col.colDef.showFile}}