EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: iceh on November 10, 2013, 03:21:27 PM



Title: loader for panel
Post by: iceh on November 10, 2013, 03:21:27 PM
I just noticed, that the loades for the panel have no:

- onLoadSuccess
- onLoadError

Any Idea how this can be handeled via $ajax() or if there is an update available?

Thx.


Title: Re: loader for panel
Post by: iceh on November 12, 2013, 11:47:20 AM
This is my first test implementation:

loadPattern(centerLayout, url);


Code:
    function loadPattern(obj, url) {
        obj.panetl().html('<div class=\"panel-loading\">' + obj.panel('options').loadingMessage + ' </div>');
        $.ajax({
            url: url,
            success: function (data) {
                panel.html(data);
            },
            error: function (err) {
                console.log(err);
                var reload = confirm(err.status + ' ' + err.statusText + "\n\nReload?");
                if (reload)
                    loadPattern(obj, url);
                else
                    obj.panel().html("LOAD ERROR");
            }
        });
    }


Title: Re: loader for panel
Post by: yupengfei on November 15, 2013, 02:55:09 AM
great!