c0ol_jie 2016-03-10 03:39 采纳率: 33.3%
浏览 1383

一个页面中切换表格时分页栏未能作用于其相应表格的数据

图片说明

jsp页面有未读反馈和已读反馈 两个表格,现在切换表格时,下面的分页栏只对未读反馈起效果,当表格切换到已读反馈时,分页栏还是作用于未读反馈表格.求帮忙解决!!!

页面代码如下:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

  • 未读反馈
  • 已读反馈


    --%>



    --%>






</div>

<!-- 右边搜索栏 -->
  • 搜索

  • 关键字搜索:

  • 时间范围:

  • 邮箱账号搜索:

确认搜索
--%>
var pageSign = true; var FeedBackService = { init: function (pageIndex) { var me = this; var params = ServiceUtils.getInputDomain('feedBakForm'); params.pageIndex = pageIndex || 1; ServiceHttp.execute('${ctx}/admin/feedback/list?_=' + new Date().getTime(), params, function (cb) { if (cb.success) { me.setData(cb.result.data || []); me.setPage(cb.result.totalPages); } else { bootbox.alert(cb.message); } }) }, setData: function (data) { var me = this; $('#tab1').html(''); var html = ''; $.each(data, function (index, value) { html += '<li>'; html += '<div class="feedbackTop">'; html += '<h2>' + (value.email || '') + '</h2>'; html += '<p>' + (value.createTime || '') + '</p>'; html += '</div>'; html += '<div class="feedMain">'; html += '<p>' + (value.content || '') + '</p>'; html += '</div>'; html += '<img src="${ctx}/static/images/gray.png" class="hideImg">'; html += '</li>'; }); $('#tab1').html(html); }, setPage: function (pages) { var me = this; if (pageSign) { laypage({ cont: 'pageFooter', pages: pages || 0, skip: true, groups: 3, jump: function (obj, first) { if (!first) { me.init(obj.curr); } } }); } pageSign = false; } , reload:function(){ pageSign=true; FeedBackService.init(1); } } var FeedBack2Service = { init: function (pageIndex) { var me = this; var params = ServiceUtils.getInputDomain('feedBakForm'); params.pageIndex = pageIndex || 1; ServiceHttp.execute('${ctx}/admin/feedback/list2?_=' + new Date().getTime(), params, function (cb) { if (cb.success) { me.setData(cb.result.data || []); me.setPage(cb.result.totalPages); } else { bootbox.alert(cb.message); } }) }, setData: function (data) { var me = this; $('#tab2').html(''); var html = ''; $.each(data, function (index, value) { html += '<li>'; html += '<div class="feedbackTop">'; html += '<h2>' + (value.email || '') + '</h2>'; html += '<p>' + (value.createTime || '') + '</p>'; html += '</div>'; html += '<div class="feedMain">'; html += '<p>' + (value.content || '') + '</p>'; html += '</div>'; html += '<img src="${ctx}/static/images/gray.png" class="hideImg">'; html += '</li>'; }); $('#tab2').html(html); }, setPage: function (pages) {alert(111) var me = this; if (pageSign) { laypage({ cont: 'pageFooter', pages: pages || 0, skip: true, groups: 3, jump: function (obj, first) { if (!first) { me.init(obj.curr); } } }); } pageSign = false; }, reload:function(){ pageSign=true; FeedBack2Service.init(1); } } $(function () { // FeedBackService.init(1); $('#feedBackSearch').on('click', function () { pageSign = true; FeedBackService.init(1); FeedBack2Service.init(1); }) }) function tab(pid) { var tabs = ["tab1", "tab2"]; for (var i = 0; i < 7; i++) { if (tabs[i] == pid) { document.getElementById(tabs[i]).style.display = "block"; $('#navli'+i).eq(0).addClass("navCurrent"); if(tabs[i]=='tab1'){ FeedBackService.init(1); }else{ FeedBack2Service.init(1); } } else { document.getElementById(tabs[i]).style.display = "none"; $('#navli'+i).eq(0).removeClass("navCurrent"); } } }; /* laydate({ elem: '#hello', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class' event: 'focus', //响应事件。如果没有传入event,则按照默认的click festival: true //显示节日 }); */
  • 写回答

1条回答

  • wu_xue 2016-03-14 08:37
    关注

    代码好凌乱,没有看懂,可能是切换表格的时候,分页作用的id没有切换!

    评论

报告相同问题?

悬赏问题

  • ¥15 fluent的在模拟压强时使用希望得到一些建议
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退