EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: lloyd on August 21, 2017, 05:59:14 AM



Title: [SOLVED] combobox loader with loading icon
Post by: lloyd on August 21, 2017, 05:59:14 AM
This code does not work if I make any change properties. IE. the combobox icon.
How can I change the combobox icon with the loader is call?

This solves the problem.  :D
Code:
   
$('.textbox-icon').removeClass('icon-search');
$('.textbox-icon').addClass('icon-loading');
 

Code:
var emailAddresses = function(param, success, error) {
    var q = param.q || '';
    
    if (q.length < 2) {
        return false;
    }

// loader fails if this line is uncommented.    
//    $(this).combobox({iconCls: 'icon-loading'});
    
    $.ajax({
        url: 'emailAddresses.php',
        dataType: 'json',
        data: {
            q: q
        },
        success: function(data){
            var items = $.map(data, function(ename, index){
                return {
                    id: index,
                    name: ename.name,
                    email: ename.email
                };
            });
            success(items);
        },
        error: function(){
            error.apply(this, arguments);
        }
    });

// loader fails if this line is uncommented.        
//    $(this).combobox({iconCls: 'icon-search'});
}


TypeError: _4bf is undefined[Learn More]  jquery.easyui.min.js:6492:5
_4bd http://localhost/phpifm/js/easyUI/jquery.easyui.min.js:6492:5
validate/< http://localhost/phpifm/js/easyUI/jquery.easyui.min.js:6613:1
each http://localhost/phpifm/js/easyUI/jquery.min.js:2:2973
each http://localhost/phpifm/js/easyUI/jquery.min.js:2:833
validate http://localhost/phpifm/js/easyUI/jquery.easyui.min.js:6612:8
$.fn.validatebox http://localhost/phpifm/js/easyUI/jquery.easyui.min.js:6587:8
_4ab/</_4ad.timer< http://localhost/phpifm/js/easyUI/jquery.easyui.min.js:6441:1
GET
XHR
http://localhost/phpifm/emailAddresses.php [HTTP/1.1 200 OK 93ms]