首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >不带弓的角形智能桌

不带弓的角形智能桌
EN

Stack Overflow用户
提问于 2016-03-23 23:58:35
回答 1查看 271关注 0票数 0

我想使用angular智能表库,但我们没有使用bower,所以我从github下载了文件,我得到了文件" smart -table.min.js“并引用了它,我没有控制台错误,但当我尝试使用智能表格功能时,如分页,它不起作用。

我是否必须添加其他文件(CSS)??

代码语言:javascript
运行
复制
<table st-table="rowCollection" class="table table-striped">
                        <thead>
                        <tr>
                            <th st-sort="firstName">first name</th>
                            <th st-sort="lastName">last name</th>
                            <th st-sort="birthDate">birth date</th>
                            <th st-sort="balance">balance</th>
                            <th>email</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="row in rowCollection">
                            <td>{{row.firstName | uppercase}}</td>
                            <td>{{row.lastName}}</td>
                            <td>{{row.birthDate | date}}</td>
                            <td>{{row.balance | currency}}</td>
                            <td><a ng-href="mailto:{{row.email}}">email</a></td>
                        </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="5" class="text-center">
                                    <div st-pagination="" st-items-by-page="10" st-displayed-pages="7"></div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>

请帮个忙

EN

回答 1

Stack Overflow用户

发布于 2016-03-29 13:29:24

在ng-app定义中,确认您引用的是'smart-table':

代码语言:javascript
运行
复制
var myApp = angular.module('myApp', [
  'smart-table'
]);

在您的控制器中,确保正确定义了"rowCollection“:

代码语言:javascript
运行
复制
$scope.rowCollection = [
{ firstName: "abc", lastName: "def", birthDate: "1/1/2010", balance: 0 },
{ firstName: "abc", lastName: "def", birthDate: "1/1/2010", balance: 0 },
{ firstName: "abc", lastName: "def", birthDate: "1/1/2010", balance: 0 }
]

只要您引用了正确的智能表min.js文件,并且具有适当的angular.js版本(1.5+),您就应该很幸运。

代码语言:javascript
运行
复制
<script type="text/javascript" src="components/angular/angular.min.js">   </script>
<script type="text/javascript" src="components/smart-table/smart-table.min.js"></script>

如果仍然不起作用,请上传你的完整标记,我们可以提供进一步的帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36182966

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档