Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 角度-动态打印ng表格标题_Javascript_Angularjs_Ngtable - Fatal编程技术网

Javascript 角度-动态打印ng表格标题

Javascript 角度-动态打印ng表格标题,javascript,angularjs,ngtable,Javascript,Angularjs,Ngtable,我被卡住了,我想使用ng表格动态打印子标题,标题应该是type1 type2 type3,细节必须是主标题,子类型值必须是详细的子标题,请参见下面的图片 非常感谢您的帮助。请尝试以下方法: 你好{{name}} 细节 {{i.type1}} {{i.type2} {{i.type3} {{d.subsubcode} $scope.detailsCount=0; $scope.detailsColCount=函数(详细信息){ 如果(details.length>$scope.detailsC

我被卡住了,我想使用ng表格动态打印子标题,标题应该是type1 type2 type3,细节必须是主标题,子类型值必须是详细的子标题,请参见下面的图片

非常感谢您的帮助。

请尝试以下方法:


你好{{name}}

细节 {{i.type1}} {{i.type2} {{i.type3} {{d.subsubcode} $scope.detailsCount=0; $scope.detailsColCount=函数(详细信息){ 如果(details.length>$scope.detailsCount){ $scope.detailscont=details.length; } };
试试这个:


你好{{name}}

细节 {{i.type1}} {{i.type2} {{i.type3} {{d.subsubcode} $scope.detailsCount=0; $scope.detailsColCount=函数(详细信息){ 如果(details.length>$scope.detailsCount){ $scope.detailscont=details.length; } };
Plunker-Plunker-谢谢你花时间在这个问题上,但我更关心标题,比如下面有一个b c d a1 b1 c1 d1记录的type1 type2 type3 a b c d,在b c d之上有一个明显的“细节”标题。谢谢你花时间在这个问题上,但我更关心标题,类似于类型1类型2类型3 a b c d,下面有一个b c d a1 b1 c1 d1作为记录,很明显,b c d顶部有“详细信息”标题。
            <body ng-controller="MainCtrl">
              <p>Hello {{name}}!</p>
              <table ng-table="tableParams">
                <tr>
                  <td colspan="3"></td>
                  <td colspan="{{detailsCount}}" style="text-align:center">Details</td>
                </tr>
                <tr ng-repeat="i in dataObject">
                  <td title="'Type1'">{{i.type1}}</td>
                  <td title="'Type2'">{{i.type2}}</td>
                  <td title="'Type3'">{{i.type3}}</td>
                  <td ng-repeat="d in i.details" ng-init="detailsColCount(i.details)">{{d.subTypeCode}}</td>
                </tr>
              </table>
            </body>

            $scope.detailsCount = 0;
            $scope.detailsColCount = function(details){
                  if (details.length > $scope.detailsCount) {
                    $scope.detailsCount = details.length;
                  }
                };