layui table 改

    F.prototype.pullData = function(e) {

   success: function (t) {
                    var da001 = i;
                    window.getdata1234567(da001);
                    "function" == typeof a.parseData && (t = a.parseData(t) || t),
 ////F.prototype.renderData = function(e, n, o, r) ;  e=json对象;n =第几页,o=总数据数;r=未定义 
  window.getobj.renderData(e,1,21);
window.getdata1234567 = function (data) {
    window.getobj = data;
}
layui.define(...);
  case 'reload':
                //调用table.pullData
                ////F.prototype.renderData = function(e, n, o, r) ;  e=json对象;n =第几页,o=总数据数;r=未定义 
                var jsonstr = '';
                var e = JSON.parse(jsonstr);
                var t = table;
                var that = this;
                window.getobj.renderData(e,1,21);
    

 二改

   var that_obj;
 table.render(
        {
        }
        ,
        function (data) {
            that_obj = data;
        }
    );
        d.render = function (e,callback) {
        var t = new F(e);
        callback = callback || new Function();
        callback(t);
        return c.call(t)
  //F.prototype.renderData = function(e, n, o, r) ;  e=json对象;n =第几页,o=总数据数;r=未定义 
                var jsonstr = '';
                var jsonstr = jsonstr.replace(/\\/g, "\\\\");
                var e = JSON.parse(jsonstr);
                var n = table;
                var that = this;
                that_obj.renderData(e, 1, 15);
      form.render();

 

 

parent.document.getElementById("search").click(); //执行父页面 查询事件

三  改....

  var that_obj;
    var call_back = function (data, data1) {
        if (data != null) {
            that_obj = data;
            return {};
        }
        ////增加传递 参数
        if (data1 != null) {
            var r = data1;
            r.where = 123456;
            return r;
        }
    };

    //加载数据
    function load_data(data) {
        //F.prototype.renderData = function(e, n, o, r) ;  e=json对象;n =第几页,o=总数据数;r=未定义
        //var e = JSON.parse(json_str);
        e = data;
        that_obj.renderData(e, 1, e.count);
        form.render();
    }
    //请求数据
    //执行提交 事件
    function search_post() {
        var posturl = "/Backstage/HFEventInfo/list/";
        var index = layer.msg('查询中,请稍候...', { icon: 16, time: false, shade: 0 });
        setTimeout(function () {
            p_f1();
            layer.close(index);
        }, 300);
        function p_f1() {
            myxhr.send_data(posturl,
                function () {
                    //var files = document.getElementById("input-file").files;
                    var page_size = document.getElementById("txt_pagesize").value;
                    var type_id = document.getElementById("typeid").value;
                    var formData = new FormData();
                    formData.append("page", 1);
                    formData.append("limit", page_size);
                    formData.append("typeid", type_id);
                    return formData;
                },
                function (data) {
                    var that = data;
                    //var obj = JSON.parse( data.data);
                    if (data && data.code == 0) {

                        load_data(data);

                        //outputImg.setAttribute("code", obj.code);

                    }
                }
            );
        }

    }

    table.render(
        {
        }
        , call_back
    );

//table .js

d.render = function (e, callback) {
var t = new F(e);
callback = callback || new Function();
win_handle_data = callback;
callback(t);

return c.call(t)
}

var r = {}; r[l.pageName] = e, r[l.limitName] = a.limit; var d = t.extend(r, a.where);
"function" == typeof win_handle_data && (r = win_handle_data(null, r));
a.contentType && 0 == a.contentType.indexOf("application/json") && (d = JSON.stringify(d)), t.ajax({

"use strict";
var win_handle_data;

//----

      that_obj.pullData(1); //加载第一页数据   无需 返回的json数据 二次无法处理

 

//---------其他研究
        //var a = layui.laypage;
        //var s = that_obj.config;
        //var t = layui.$
        //var o = e.count;
        //void (s.page && (s.page = t.extend(
        //    {
        //    elem: "layui-table-page" + s.index,
        //    count: o,
        //    limit: s.limit,
        //    limits: s.limits || [10, 20, 30, 40, 50, 60, 70, 80, 90],
        //    groups: 3,
        //    layout: ["prev", "page", "next", "skip", "count", "limit"],
        //    prev: '<i class="layui-icon">&#xe603;</i>',
        //    next: '<i class="layui-icon">&#xe602;</i>',
        //    jump: function (e, t) {
        //        t || (c.page = e.curr,
        //            s.limit = e.limit,
        //            c.loading(),
        //            c.pullData(e.curr))
        //    }
        //}, s.page),
        //    s.page.count = o,
        //    a.render(s.page)));
//加载数据
function load_data(data) {
//F.prototype.renderData = function(e, n, o, r) ; e=json对象;n =第几页,o=总数据数;r=未定义
//var e = JSON.parse(json_str);
e = data;
//that_obj.pullData(1); //加载第一页数据

that_obj.config.page = true; //重置 翻页数据
that_obj.renderData(e, 1, e.count); //绑定数据
that_obj.setColsWidth();//自动列宽
that_obj.renderForm(); //渲染列表数据
form.render();

}

 

posted @ 2019-09-20 22:08  enych  阅读(1110)  评论(0编辑  收藏  举报