Syncfusion grid with angular support:向rowTemplate中添加工作按钮

Syncfusion grid with angular support: adding working button to rowTemplate?

本文关键字:rowTemplate 添加 工作 按钮 grid with angular support Syncfusion      更新时间:2023-09-26

我正在使用syncfusion网格,并希望在最后一列中有一个按钮。我使用rowTemplate如这里所述http://help.syncfusion.com/UG/JS_CR/ejGrid.html#rowTemplate.

我的网格有这样的模板

<!-- template for table rows-->
<script id="rowTmpl" type="text/x-jsrender">
  <tr style="background-color: {{:color}}">
    <td>{{:fullName}}</td>
    <td>{{:subjectType}}</td>
    <td>{{:statusKey}}</td>
    <td>
      <button ng-click="deleteRow({{:fullName}})"><span class="glyphicon glyphicon-remove"></span></button>
    </td>
  </tr>
</script>

和我在$scope中定义了deleteRow,但它不会命中。

Table本身被简单地配置为使用对象作为数据源,并使用角绑定。

   <div ej-grid="ej-grid" e-datasource="subject.list" e-allowgrouping="false" e-pagesettings-pageSize="100" e-pagesettings-currentpage="page" e-allowpaging="true" e-columns="gridColumns" e-rowtemplate="#rowTmpl" e-editsettings="gridEditSettings"></div>

你不应该在ng-click表达式中使用大括号({{}})。你应该这样写:删除