easyui datagrid 首次不加载做法

我们一般遇到首次不执行查询,只有你点击查询按钮才查询的功能

我使用easyui的datagird做法是这样的:

onBeforeLoad: function (param) {
            var firstLoad = $(this).attr("firstLoad");
            if (firstLoad == "false" || typeof (firstLoad) == "undefined")
            {
                $(this).attr("firstLoad","true");
                return false;
            }
            return true;
        }

在datagrid的onBeforeLoad事件中判断是否有首次加载属性与属性值是否代表首次,首次的话则将值更改且跳出加载了!

猜你喜欢

转载自www.cnblogs.com/aigeileshei/p/10308477.html