代码之家  ›  专栏  ›  技术社区  ›  agusluc

在ng网格列单元格中使用行值Template

  •  6
  • agusluc  · 技术社区  · 11 年前

    我正在尝试添加一个列,该列具有指向另一页的链接(是一个ng网格表)。该链接包含该行的一个值

    我尝试了这样的方法:

    $scope.columns = [
      {field:'id', displayName:'#'},
      {field:'name', displayName:'Name'},
      {field:'view', displayName:'Action', cellTemplate: '<a href="http://foo.com/person/' +  {row.getProperty(col.id)} + '">[View Details]</a>'}
    ];
    

    但没用,有什么想法吗?

    4 回复  |  直到 8 年前
        1
  •  7
  •   Chandermani    11 年前

    表达式应为

    {{row.getProperty(col.id)}}

    {{row.getProperty(\'id\')}}

        2
  •  2
  •   Stas Yak    10 年前

    或者你可以

    {{row.entity[\'id\']}}
    
        3
  •  0
  •   Michael Gustus    10 年前

    可以使用ng网格属性COL_FIELD:

    {{COL_FIELD}}
    

    例如:

    cellTemplate: '<div class="ngCellText">{{COL_FIELD | date}}</div>'
    
        4
  •  0
  •   thor BabarQB    9 年前

    尝试以下操作:

    cellTemplate : href="https://localhost:8082{{row.entity.ImgLink}}"