1

这是我的 HTML:

<table st-table="prizesByCompany" st-safe-src='safePrizesByCompany' class="table table-striped"  >
    <thead>
        <tr>
            <th st-sort='status'>Filtros</th>
            <th st-sort='text'>Campanha</th>
            <th>
                <button class="btn" ui-sref='campaignAdd'>Nova Campanha</button>
            </th>
        </tr>
        <tr>
            <th colspan="3"><input st-search="text" class="form-control" placeholder="Pesquise..." type="text"/></th>
        </tr>
    </thead>
    <tbody>

        <tr ng-repeat="row in prizesByCompany">
            <span ng-if="row.status != 1">
                <td>
                    <button class="btn" >{{row.status | company_status_button}}</button>
                </td>
                <td><a ui-sref = 'campaignView({action: "view", id:{{row.id}}})'>{{row.text}}</a></td>
                <td>
                    <div ng-if='row.status == 2'>
                        <button class='btn' ui-sref='campaignEditRequest({id: {{row.id}}})'>Editar</button>
                        <button class='btn'>Solicitar Pausa </button>
                        <button class='btn' ng-click='deactivateCampaign($index)'>Solicitar Cancelamento</button>
                        <button class='btn'>Relatório</button>
                    </div>
                    <div ng-if='row.status == 3'>
                        <button class='btn' ng-click='activateCampaign($index)'>Solicitar Reativação</button>
                        <button class='btn'>Relatório</button>
                    </div>
                    <div ng-if='row.status == 1'>
                        <button class='btn' ng-click='activateCampaign($index)'>Solicitar Reativação</button>
                        <button class='btn'>Relatório</button>
                    </div>
                </td>

            </span>
        </tr>
    </tbody>
</table>

表格显示正常,但插件不起作用。

关于收藏:

                $scope.prizesByCompany = data.response
                $scope.safePrizesByCompany = angular.copy($scope.prizesByCompany);

它没有显示任何错误。我查看了 Smart Table 文档,看看我是否标记了错误,但似乎一切正常。我不知道现在该做什么。

会发生什么?

谢谢。

4

1 回答 1

0

我认为,这是由于表标记中的 st-safe-src 拼写错误(而不是 str-safe-src)。您还应该用双引号编写属性值

<th st-sort="status">Filtros</th>
<th st-sort="text">Campanha</th>

此外,您应该为您的收藏使用相同的参考:

$scope.safePrizesByCompany = data.respsonse
$scope.prizesByCompany = [].concat($scope.safePrizesByCompany) // actually you don't even need this line and can simply remove it
于 2015-04-03T03:17:51.483 回答