ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Is that possible to change a specific column's html ?

Open itgoujie2 opened this issue 11 years ago • 4 comments

For some columns, I need some custom behaviors, so I need to customize its html, can I do that ?

itgoujie2 avatar Jan 09 '15 21:01 itgoujie2

There are a number of specific ways to customise:

  • cellTemplate
  • headerCellTemplate
  • headerFilter
  • cellFilter
  • cellClass

If none of those meet your needs, then you can write a custom directive to extend it.

PaulL1 avatar Jan 09 '15 21:01 PaulL1

Thanks for the response, in my case, for a column, for each row of that column, I need a different html. But using cellTemplate, that is for the whole column. I am wondering if I can define cellTemplate when I define the data ?

itgoujie2 avatar Jan 12 '15 22:01 itgoujie2

There is no way to have a per-cell html. Usually you'd do that by setting your cell template to a directive, and then burying your optionality inside that directive, or if your logic isn't too complex, just using an ng-if in the cell template.

PaulL1 avatar Jan 12 '15 23:01 PaulL1

Solution provided, and no new comments for over 3 weeks. Assuming issue is resolved, closing.

PaulL1 avatar Jan 29 '15 23:01 PaulL1