소스 검색

dataSource Fn setLoading

luoyifan 3 년 전
부모
커밋
a688981469
1개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 3
      src/controls/grid.js

+ 9 - 3
src/controls/grid.js

@@ -169,15 +169,21 @@ export default function () {
             if (config.dataSourceCallbackFn) {
                 // 函数请求刷新
                 const scope = lookupScope(this)
-                // me.setLoading(true)
+                _.defer(()=>{
+                    me.setLoading(true)
+                })
                 config.dataSourceCallbackFn.call(scope, me, {
                     successCallback(value) {
                         me._setDataReal(value)
-                        // me.setLoading(false)
+                        _.defer(()=>{
+                            me.setLoading(false)
+                        })
                         me.fireEvent('dataLoadComplete', me, true, value);
                     },
                     failCallback(error) {
-                        // me.setLoading(false)
+                        _.defer(()=>{
+                            me.setLoading(false)
+                        })
                         me.fireEvent('dataLoadComplete', me, false, error);
                     }
                 })