使用angularjs更改项目中的字段类型

时间:2016-12-04 07:21:08

标签: html angularjs

我想更改链接中的字段列大小新模板的类型:http://plnkr.co/edit/yfU1zmkRXjrZwJAG5PS4?p=preview

在文件 tree-grid-directive.js 中:

(function () {
angular.module('treeGrid', []).directive('treeGrid', ['$timeout',
    function ($timeout) {
        return {
            restrict: 'E',
            //templateUrl:'tree-grid-template.html',
            //template:"<div><table class=\"table table-bordered table-striped tree-grid\"><thead class=\"text-primary\"><tr><th>{{expandingProperty.displayName || expandingProperty.field || expandingProperty}}</th><th ng-repeat=\"col in colDefinitions\">{{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[expandingProperty.field] || row.branch[expandingProperty]}}</span></td><td ng-repeat=\"col in colDefinitions\">{{row.branch[col.field]}}</td></tr></tbody><table></div>",
            template: "<div class=\"table-responsive\">\
          <table class=\"table tree-grid\">\
              <thead>\
              <tr>\
                  <th>{{expandingProperty.displayName || expandingProperty.field || expandingProperty}}</th>\
                  <th ng-repeat=\"col in colDefinitions\">{{col.displayName || col.field}}</th>\
              </tr>\
              </thead>\
              <tbody>\
              <tr ng-repeat=\"row in tree_rows | filter:{visible:true} track by row.branch.uid\"\
                  ng-click=\"row.branch.expanded = !row.branch.expanded\"\
                  ng-class=\"'level-' + {{ row.level }} + (row.branch.selected ? ' active':'')\" class=\"tree-grid-row\">\
                  <td><a ng-click=\"user_clicks_branch(row.branch)\"><i ng-class=\"row.tree_icon\"\
                             class=\"indented tree-icon\"></i>\
                      </a><span class=\"indented tree-label\" ng-click=\"user_clicks_branch(row.branch)\">\
                        {{row.branch[expandingProperty.field] || row.branch[expandingProperty]}}</span>\
                  </td>\
                  <td ng-repeat=\"col in colDefinitions\">{{row.branch[col.field]}}</td>\
              </tr>\
              </tbody>\
          </table>\
      </div>",
            replace: true,
            scope: {
                treeData: '=',
                colDefs: '=',
                expandOn: '=',
                onSelect: '&',
                initialSelection: '@',
                treeControl: '='
            },...

如何更改列而不是字段类型调整大小新模板来输入treeGrid中的更新数据?

0 个答案:

没有答案