首页 > 解决方案 > 单击主标题时如何隐藏html表格特定的子标题

问题描述

我通过使用“data-ng-repeat”填充主标题、子标题来获得 html 表。具有展开按钮的主标题这些标题正在从数据库中获取数据。我可以隐藏 td 正文项目,但是当我单击主标题时我需要隐藏特定的子标题列我如何在页面加载时隐藏特定的子标题项目我如何接受条件。

<table>
        <thead>
            <tr>
                <th>
                    <span>{{mainH}}</span>
                    <span data-ng-click="clickf(first)">+</span>                   
                </th>
            </tr>
            <tr>
                <th data-ng-repeat="SHeader in Subheader">
                    <span>{{SHeader.Subheader}}</span>
                </th> ///this Subheader hide some of the particular sub header items
            </tr>
        </thead>
        <tbody>
            <tr data-ng-repeat="data in items">              

                <td><span>{{data.item0}}</span></td>
                <td><span>{{data.item1}}</span></td>
                <td data-ng-show="show"><span>{{data.item2}}</span></td>
                <td data-ng-show="show"><span>{{data.item2}}</span></td>               
            </tr>
        </tbody>
    </table>

Factory.HttpRequest('page.aspx/GetDetails')
            .success(function (data) {
 var Details = data.d;               
                $scope.Subheader= Details.SubDescriptionDetails;
}

标签: htmlangularjs

解决方案


推荐阅读