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

Support template URLs

Open justinsa opened this issue 12 years ago • 6 comments

All of the template configuration options currently expect a code fragment to be provided. Relevant configuration values should be available for specifying template URLs that load the HTML fragment from a file.

e.g., rowTemplateUrl: 'partials/rowTemplate.html'

Relevant configuration options, judging by the APi documentation would be:

Grid Options

  • aggregateTemplateUrl
  • checkboxCellTemplateUrl
  • checkboxHeaderTemplateUrl
  • rowTemplateUrl

ColumnDefs Options

  • cellTemplateUrl
  • editableCellTemplateUrl
  • headerCellTemplateUrl

justinsa avatar Jun 18 '14 14:06 justinsa

It turns out a template URL is supported for these properties but it expects the value in the same property as where the code fragment is provided. This does not conform with the style of Angular directives. Developers familiar with directives will expect the option to specify a template URL to be in an independent property, not an overload to the code fragment property.

justinsa avatar Jun 22 '14 09:06 justinsa

Please fix this - use xxxUrl, and have that code use $templateCache.

DavidSouther avatar Jun 23 '14 16:06 DavidSouther

+1. The default header cell template is chunky, to say the least, so if you need to make a change it ends up being a pretty big block of HTML sitting in your file.

ianlyons avatar Jul 08 '14 02:07 ianlyons

:+1:

cschroedl-gov avatar Aug 18 '14 20:08 cschroedl-gov

This will be the case in 3.0. In its beta form it currently supports template urls, $templateCache ids, text strings, and promises.

c0bra avatar Aug 18 '14 20:08 c0bra

Thank you!

cschroedl-gov avatar Aug 18 '14 21:08 cschroedl-gov