【问题标题】:angular ui-grid add img link to column headers角度 ui-grid 将 img 链接添加到列标题
【发布时间】:2017-02-21 19:35:11
【问题描述】:

我需要在某些列标题中注入一个 img 链接。所有这些标题都对其进行了下拉过滤。通过这个网站往下看:https://github.com/angular-ui/ui-grid/wiki/Templating

当我将其用于 1 列上的单元格模板进行测试并单击标题名称时,出现错误:

TypeError: v2.sort is not a function
    at fn (eval at compile (angular.js:15156), <anonymous>:4:241)
    at e (angular.js:26744)
    at m.$eval (angular.js:17972)
    at m.$apply (angular.js:18072)
    at HTMLDivElement.<anonymous> (angular.js:26749)
    at cg (angular.js:3613)
    at HTMLDivElement.d (angular.js:3601)

即使在出现错误之前,该列也没有用于排序的下拉箭头,也没有下拉过滤器。我怎么得到它?好像这不是默认模板?

【问题讨论】:

    标签: angularjs angular-ui-grid


    【解决方案1】:

    废话,似乎是错误的模板。我在这里使用了一个,它起作用了:

    https://github.com/angular-ui/ui-grid/blob/master/src/templates/ui-grid/uiGridHeaderCell.html

    有趣的是,如果我把它移到它自己的 html 文件中,它会说:

    fetching url Views/CustomHeaderCellTemplate.html
    

    但标题是空白的,就像它不起作用一样。不知道为什么会这样。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-11
      • 2016-01-17
      • 2019-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多