找回密码
 立即注册

QQ登录

只需一步,快速开始

liushutao

金牌服务用户

14

主题

35

帖子

99

积分

金牌服务用户

积分
99

活字格认证

liushutao
金牌服务用户   /  发表于:2016-9-21 17:27  /   查看:3521  /  回复:5
本帖最后由 Lenka.Guo 于 2016-9-21 17:51 编辑

                    currentpage = new Number($("div[pname='当前页号']").children("input").val());
                    totalpage = new Number($("div[pname='总页数']").children("input").val());
                    currentRows = new Number($("#hidePageRow").val());

                    $("input[bname='bpagenumber']").val(currentpage + "/" + totalpage);

5 个回复

倒序浏览
liushutao
金牌服务用户   /  发表于:2016-9-21 17:30:39
沙发

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
liushutao
金牌服务用户   /  发表于:2016-9-21 17:32:50
板凳
definition1.Report.ReportParameters.Add(ptotalpage);
            //当前页号
            GrapeCity.ActiveReports.PageReportModel.ReportParameter pcurrentpage = new GrapeCity.ActiveReports.PageReportModel.ReportParameter();
            pcurrentpage.Name = "当前页号";
            pcurrentpage.Prompt = "当前页号";
            pcurrentpage.DataType = GrapeCity.ActiveReports.PageReportModel.ReportParameterDataType.Integer;
            if (currentpage == 0)
            {
                // 通过reportPath中参数名称和参数值查询总页数,如果 totalpage = -1,
                // 说明是在新查询条件下第一次执行查询,需要先查询总页数,我这里先假设查询总页数为50页
                if (int.Parse(ptotalpage.DefaultValue.Values[0].Expression) > 0)
                {
                    pcurrentpage.DefaultValue.Values.Add("1");
                }
                else
                {
                    pcurrentpage.DefaultValue.Values.Add("0");
                }
            }
            else
            {
                // currentpage不为0,说明是在执行翻页操作
                pcurrentpage.DefaultValue.Values.Add(currentpage.ToString());
            }
            definition1.Report.ReportParameters.Add(pcurrentpage);
回复 使用道具 举报
Lenka.Guo讲师达人认证 悬赏达人认证
超级版主   /  发表于:2016-9-21 17:50:58
地板
如电话沟通,怀疑是未找到显示页码的Input,bpagenumber名称不正确:  $("input[bname='bpagenumber']").val(currentpage + "/" + totalpage);
回复 使用道具 举报
liushutao
金牌服务用户   /  发表于:2016-9-22 10:57:18
5#
那个文本框是databind方法,我就是改动文本框的值也不行,还是你们那边提供解决方案吧
回复 使用道具 举报
Lenka.Guo讲师达人认证 悬赏达人认证
超级版主   /  发表于:2016-9-22 14:01:57
6#
liushutao 发表于 2016-9-22 10:57
那个文本框是databind方法,我就是改动文本框的值也不行,还是你们那边提供解决方案吧

您好:
根据您之前提供的MVC示例,发现bpagenumber,是您那边把GrapeCity.ActiveReports.Viewer.Html.js 文件中 templates.desktop的显示页码的input控件中的属性修改为bname='bpagenumber',以此来定位的。

而如果UIType为Mobile类型,则加载的是:  templates.mobile 这个里面未修改,所以无法进行页号赋值。

因为修改js文件是不安全的做法,所以建议您将页号赋值修改为: $('input', ".navbar-left").val(currentpage + "/" + totalpage);

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部