zoukankan      html  css  js  c++  java
  • jquerymobile知识点:动态Grid的绑定以及刷新

    下面jquerymobile是ajax动态绑定和刷新的例子。直接上图以及代码。

    下面是实例代码:

    //初始绑定
        function GetInitBind(PageIndex, PageSize, sqlwhere, OrderType) {
            showLoading();
            var adapGrid = $("#adapGrid");
            $.ajax({
                type: "POST",
                url: "/Ashx/YouHui.ashx?MethodName=GetSealsList&PageSize=" + PageSize + "&PageIndex=" + PageIndex + "&date=" + new Date().getTime() + "&SqlWhere=" + sqlwhere + "&OrderType=" + OrderType,
                data: "",
                dataType: "json",
                success: function (data) {
                    data = eval(data);
                    var strleft = "";
                    $.each(data.List, function (i, item) {//打折商品列表
                        if (i % 2 == 0) {
                            strleft += "<div class='ui-block-a' style='height:100%'>";
                            strleft += "<img style='99%;' src='" + item.YouhuiFilepath + "'/>";
                            strleft += "<a class='descriptions'>";
                            strleft += "<p>剩余时间:" + unescape(item.Day) + "</p>";
                            strleft += "</a>";
                            strleft += "</div>";
                        } else {
                            strleft += "<div class='ui-block-b' style='height:100%'>";
                            strleft += "<img style='99%;' src='" + item.YouhuiFilepath + "'/>";
                            strleft += "<a class='descriptions'>";
                            strleft += "<p>剩余时间:" + unescape(item.Day) + "</p>";
                            strleft += "</a>";
                            strleft += "</div>";
                        }
                    });
                    adapGrid.append(strleft).trigger("create");//重要(刷新)
                },
                error: function (data) {
                   // $("#goodlist").html("数据有误!");
                }
            });
            hideLoading();
        }
  • 相关阅读:
    Unzip 解压报错
    Linux ftp安装
    关于vsftp出现Restarting vsftpd (via systemctl): Job for vsftpd.service failed because the control 的解决办法
    ASP.NET开发知识总结
    移动端开发调试方法总结
    移动H5优化指南
    基于windows下,node.js之npm
    微服务理解
    SQL Server 触发器
    jQuery验证控件jquery.validate.js使用说明+中文API
  • 原文地址:https://www.cnblogs.com/dekevin/p/4220476.html
Copyright © 2011-2022 走看看