自定义树网格指令模板

时间:2015-12-31 09:42:01

标签: angularjs

我需要帮助, 我正在使用这个树网格指令https://github.com/khan4019/tree-grid-directive,我想剪切模板,但我不知道在哪里这样做。 将template-url="pathtotemplate"添加到<tree-grid></tree-grid>后,树格消失了: html文件:

<tree-grid tree-data="tree_data" tree-control="my_tree" col-defs="col_defs" 
            expand-on="expanding_property" on-select="my_tree_handler(branch)" on-click="my_tree_handler_s(branch)" 
             expand-level="2" template-url="temp/tree-grid-template.html"
  icon-leaf= "glyphicon glyphicon-globe"></tree-grid>

模板htmlfile(我没有改变任何东西):

<script type="text/ng-template" id="tree-grid-template.html">
    <div>
        <table class="table table-bordered table-striped tree-grid">
            <thead class="text-primary">
                <tr>
                    <th>{{expandOn}}</th>
                    <th ng-repeat="col in colDefs">{{col.displayName || col.field}}</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="row in tree_rows | filter:{visible:true} track by row.branch.uid" 
ng-class="'level-' + {{ row.level }} + (row.branch.selected ? ' active':'')" 
class="tree-grid-row">
                    <td class="text-primary"><a ng-click="user_clicks_branch(row.branch)">
<i ng-class="row.tree_icon" ng-click="row.branch.expanded = !row.branch.expanded" 
class="indented tree-icon"></i></a>
<span class="indented tree-label">{{row.branch[expandOn]}}</span></td>
                    <td ng-repeat="col in colDefs">{{row.branch[col.field]}}</td>
                </tr>
            </tbody>
        </table>
    </div>
</script>

我也尝试过(在tree-grid-directive.js文件中)用我的模板将每个网址更改为一个网址,但没有任何变化,它只显示了树网格没有变化。

谢谢。最好的问候。

0 个答案:

没有答案