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();
        }
  • 相关阅读:
    静态与非静态(转改)
    关于odp.net的FetchSize属性
    SQL_SERVER 导oracle(转)
    win7电脑上wifi
    Oracle对象统计信息
    SQL_SERVER 连接oracle(转)
    linq in 语法
    关于引擎的设计
    温习设计模式
    技巧类
  • 原文地址:https://www.cnblogs.com/dekevin/p/4220476.html
Copyright © 2011-2022 走看看