当前位置: 首页 > 知识库问答 >
问题:

智能表分页引发错误

曹驰
2023-03-14

我的页面正在成功加载智能表js,但是当我尝试使用分页功能(如留档所示)时,我收到以下错误

http://localhost:47544/template/smart-table/pagination.html Failed to load resource: the server responded with a status of 404 (Not Found)

Error: [$compile:tpload] http://errors.angularjs.org/1.3.7/$compile/tpload?p0=template%2Fsmart-table%2Fpagination.html

我不确定我做错了什么,但下面是我的代码。任何帮助都会很好!谢谢

<body>
<div ng-controller="testController as ctrl">
    <div>
        <div class="page-header"><h2>Table Test</h2></div>
        <div class="row">
            <div class="col-xs-12 col-sm-8 col-lg-6">
                <table st-table="ctrl.myData" class="table table-striped">
                    <thead>
                        <tr>
                            <th colspan="10"><input st-search="" placeholder="Universal Search" class="input-sm form-control" type="search"/></th>
                        </tr>
                        <tr>
                            <th st-sort="name">name</th>
                            <th st-sort="location">location</th>
                            <th st-sort="age">age</th>
                            <th st-sort="phone">phone</th>
                        </tr>
                        <tr>
                            <th><input st-search="name" placeholder="Search" class="input-sm form-control" type="search" /></th>
                            <th><input st-search="location" placeholder="Search" class="input-sm form-control" type="search" /></th>
                            <th><input st-search="age" placeholder="Search" class="input-sm form-control" type="search" /></th>
                            <th><input st-search="phone" placeholder="Search" class="input-sm form-control" type="search" /></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="row in ctrl.myData">
                            <td>{{row.name}}</td>
                            <td>{{row.location}}</td>
                            <td>{{row.age}}</td>
                            <td>{{row.phone}}</td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="4" class="text-center">
                                <div st-pagination="" st-items-by-page="5" st-displayed-pages="3"></div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
            <div class="clearfix visible-xs-block"></div>
            <div class="col-xs-0 col-sm-2 col-lg-3"></div>
        </div>
    </div>
</div>
</body> 

共有1个答案

宣原
2023-03-14

现在已经太晚了,但是如果有人遇到同样的问题,你可以检查一下,也许你只是在某个地方调用了下一个方法,然后通过这个方法从缓存中删除了默认分页模板。

$templateCache.destroy(); 
$templateCache.removeAll();
$templateCache.remove('template/smart-table/pagination.html');

有关方法的信息,请查看此文档

 类似资料:
  • 我目前正在使用:“angular smart table”:“2.1.0”“angular”:“1.3.15” 单击智能表格项目时,我的应用程序会在另一个页面中显示项目详细信息。在访问项目页面后,我想回到智能表格页面上的相同页码(屏幕截图上的2):屏幕截图 我的问题: 不知道如何保存currentPage(rootscope、Parameter?) 以下是分页视图,用于管理分页: “智能表插件指令

  • 我正在使用智能表插件进行分页。 我的要求是-我从数据库中获取100条记录,同时加载,每页记录为10条。所以,分页的页数将是10页。 现在,我想当我点击第10页时(从分页),然后我想从数据库中获取另外100条记录

  • 我在Angular 2应用程序中使用ng2智能表,其中的分页有问题。我正在加载一个数据对象数组,它正确地显示了前五个(我总共有20个),但表底部的分页显示 你知道为什么会这样吗

  • 通过使用角智能表,如何使用偏移值获得结果集。比如我数据库里有100条记录 首先,我需要从数据库中获取20条记录,并且每页只显示10个项目。 点击第三页后,需要查询数据库(服务调用)并获取另外20条记录... etc(但第二页没有服务器调用) 我正在使用SmartTablePipe/ajax插件来显示记录。 如何使用这个来实现。 http://lorenzofox3.github.io/smart-

  • 问题内容: 我正在寻找智能分页的示例算法。聪明地说,我的意思是,例如,我只想显示当前页面的2个相邻页面,因此我截断了它而不是结束一个冗长的页面列表。 这是一个简单的例子,可以使它更清楚……这就是我现在所拥有的: 这就是我要结束的事情: (在此示例中,我仅显示当前页面的2个相邻页面) 我正在PHP / Mysql中实现它,并且已经对“基本”分页(没有任何删节)进行了编码,我只是在寻找一个示例来对其进

  • 我已经实现了一个Andoid应用程序-服务器端应用程序。服务器与智能卡读卡器通信。当用户在Android应用程序中触摸按钮时,将构建一个连接到服务器以验证用户。应用和服务器之间交换的消息具有以下格式: 如果消息的类型值,则表明智能卡读卡器中存在错误 如果消息的类型值,则表明智能卡中存在错误 我使用如下代码与智能卡读卡器进行通信: 智能卡IO API具有异常的类。我的问题是,我不知道何时发送类型为或