diff --git a/demo/js/config/demo.pane.js b/demo/js/config/demo.pane.js index 19d41644e..30b2415a7 100644 --- a/demo/js/config/demo.pane.js +++ b/demo/js/config/demo.pane.js @@ -4,7 +4,7 @@ * description: */ !(function () { - var Pane = BI.inherit(BI.Pane, { + var Pane = BI.inherit(BI.LoadingPane, { props: { }, diff --git a/dist/base.js b/dist/base.js index 62788d46c..ea4f3bd5f 100644 --- a/dist/base.js +++ b/dist/base.js @@ -218,31 +218,6 @@ BI.Pane = BI.inherit(BI.Widget, { }); }, - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - }, - _assertTip: function () { var o = this.options; if (!this._tipText) { diff --git a/dist/bundle.ie.js b/dist/bundle.ie.js index f4a72afd1..e83aacef3 100644 --- a/dist/bundle.ie.js +++ b/dist/bundle.ie.js @@ -35308,31 +35308,6 @@ BI.Pane = BI.inherit(BI.Widget, { }); }, - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - }, - _assertTip: function () { var o = this.options; if (!this._tipText) { @@ -57200,6 +57175,36 @@ BI.SortList = BI.inherit(BI.Widget, { BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.sort_list", BI.SortList); /** + * author: young + * createdDate: 2018/12/18 + * description: + */ +BI.LoadingPane = BI.inherit(BI.Pane, { + _mount: function () { + var isMounted = BI.Pane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } + } + }, + + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } + }, + + __loaded: function () { + this.__asking = false; + this.loaded(); + this._render(); + } +});/** * 有总页数和总行数的分页控件 * Created by Young's on 2016/10/13. */ diff --git a/dist/bundle.js b/dist/bundle.js index 6e729e92d..33dc9284c 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -35712,31 +35712,6 @@ BI.Pane = BI.inherit(BI.Widget, { }); }, - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - }, - _assertTip: function () { var o = this.options; if (!this._tipText) { @@ -57604,6 +57579,36 @@ BI.SortList = BI.inherit(BI.Widget, { BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.sort_list", BI.SortList); /** + * author: young + * createdDate: 2018/12/18 + * description: + */ +BI.LoadingPane = BI.inherit(BI.Pane, { + _mount: function () { + var isMounted = BI.Pane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } + } + }, + + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } + }, + + __loaded: function () { + this.__asking = false; + this.loaded(); + this._render(); + } +});/** * 有总页数和总行数的分页控件 * Created by Young's on 2016/10/13. */ diff --git a/dist/case.js b/dist/case.js index fd314080e..ff48ff48b 100644 --- a/dist/case.js +++ b/dist/case.js @@ -7975,14 +7975,11 @@ BI.shortcut("bi.sort_list", BI.SortList); /** * author: young * createdDate: 2018/12/18 - * description: 实现先loading 然后再渲染,解决beforeInit中loading无效 - * 继承此类,你需要明确,你的页面是根据动态请求后的结果来渲染的 - * 使用:1、在子类中使用loadedRender代替render方法;2、请求数据放到reqInitData中 + * description: */ BI.LoadingPane = BI.inherit(BI.Pane, { - _mount: function () { - var isMounted = BI.LoadingPane.superclass._mount.apply(this, arguments); + var isMounted = BI.Pane.superclass._mount.apply(this, arguments); if (isMounted) { if (this.beforeInit) { this.__asking = true; diff --git a/dist/demo.js b/dist/demo.js index 1002ec122..2849c470a 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -3504,7 +3504,7 @@ Demo.COMPONENT_CONFIG = [{ * description: */ !(function () { - var Pane = BI.inherit(BI.Pane, { + var Pane = BI.inherit(BI.LoadingPane, { props: { }, diff --git a/dist/fineui.ie.js b/dist/fineui.ie.js index b198a1ccb..264a89c85 100644 --- a/dist/fineui.ie.js +++ b/dist/fineui.ie.js @@ -35553,31 +35553,6 @@ BI.Pane = BI.inherit(BI.Widget, { }); }, - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - }, - _assertTip: function () { var o = this.options; if (!this._tipText) { @@ -57445,6 +57420,36 @@ BI.SortList = BI.inherit(BI.Widget, { BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.sort_list", BI.SortList); /** + * author: young + * createdDate: 2018/12/18 + * description: + */ +BI.LoadingPane = BI.inherit(BI.Pane, { + _mount: function () { + var isMounted = BI.Pane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } + } + }, + + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } + }, + + __loaded: function () { + this.__asking = false; + this.loaded(); + this._render(); + } +});/** * 有总页数和总行数的分页控件 * Created by Young's on 2016/10/13. */ diff --git a/dist/fineui.js b/dist/fineui.js index 594c5d02a..4f2d7d8d6 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -35957,31 +35957,6 @@ BI.Pane = BI.inherit(BI.Widget, { }); }, - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - }, - _assertTip: function () { var o = this.options; if (!this._tipText) { @@ -57849,6 +57824,36 @@ BI.SortList = BI.inherit(BI.Widget, { BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.sort_list", BI.SortList); /** + * author: young + * createdDate: 2018/12/18 + * description: + */ +BI.LoadingPane = BI.inherit(BI.Pane, { + _mount: function () { + var isMounted = BI.Pane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } + } + }, + + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } + }, + + __loaded: function () { + this.__asking = false; + this.loaded(); + this._render(); + } +});/** * 有总页数和总行数的分页控件 * Created by Young's on 2016/10/13. */ diff --git a/dist/fineui_without_jquery_polyfill.js b/dist/fineui_without_jquery_polyfill.js index bd4fd9be7..b2d372ffe 100644 --- a/dist/fineui_without_jquery_polyfill.js +++ b/dist/fineui_without_jquery_polyfill.js @@ -24464,31 +24464,6 @@ BI.Pane = BI.inherit(BI.Widget, { }); }, - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - }, - _assertTip: function () { var o = this.options; if (!this._tipText) { @@ -40862,6 +40837,36 @@ BI.SortList = BI.inherit(BI.Widget, { BI.SortList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.sort_list", BI.SortList); /** + * author: young + * createdDate: 2018/12/18 + * description: + */ +BI.LoadingPane = BI.inherit(BI.Pane, { + _mount: function () { + var isMounted = BI.Pane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } + } + }, + + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } + }, + + __loaded: function () { + this.__asking = false; + this.loaded(); + this._render(); + } +});/** * 有总页数和总行数的分页控件 * Created by Young's on 2016/10/13. */ diff --git a/src/base/pane.js b/src/base/pane.js index 6488fde38..94089d04c 100644 --- a/src/base/pane.js +++ b/src/base/pane.js @@ -17,31 +17,6 @@ BI.Pane = BI.inherit(BI.Widget, { }); }, - _mount: function () { - var isMounted = BI.Pane.superclass._mount.apply(this, arguments); - if (isMounted) { - if (this.beforeInit) { - this.__asking = true; - this.loading(); - this.beforeInit(BI.bind(this.__loaded, this)); - } - } - }, - - _initRender: function () { - if (this.beforeInit) { - this.__async = true; - } else { - this._render(); - } - }, - - __loaded: function () { - this.__asking = false; - this.loaded(); - this._render(); - }, - _assertTip: function () { var o = this.options; if (!this._tipText) { diff --git a/src/case/loading/loading_pane.js b/src/case/loading/loading_pane.js new file mode 100644 index 000000000..2218685c5 --- /dev/null +++ b/src/case/loading/loading_pane.js @@ -0,0 +1,31 @@ +/** + * author: young + * createdDate: 2018/12/18 + * description: + */ +BI.LoadingPane = BI.inherit(BI.Pane, { + _mount: function () { + var isMounted = BI.Pane.superclass._mount.apply(this, arguments); + if (isMounted) { + if (this.beforeInit) { + this.__asking = true; + this.loading(); + this.beforeInit(BI.bind(this.__loaded, this)); + } + } + }, + + _initRender: function () { + if (this.beforeInit) { + this.__async = true; + } else { + this._render(); + } + }, + + __loaded: function () { + this.__asking = false; + this.loaded(); + this._render(); + } +}); \ No newline at end of file