具有角度支持的Syncfusion网格:向rowTemplate添加工作按钮?

时间:2014-08-11 11:25:44

标签: javascript angularjs syncfusion

我正在使用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,但它没有被击中。

表本身只是配置为使用对象作为数据源,它使用角度绑定。

   <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>

1 个答案:

答案 0 :(得分:0)

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