EasyUI Forum
October 17, 2025, 01:15:20 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to set $.ajax to async:false in combobox remote  (Read 14337 times)
azizkhani
Newbie
*
Posts: 37


View Profile Email
« on: May 07, 2015, 11:35:15 AM »

how to set $.ajax to async:false in combobox remote

$.ajax({
            type: opts.method,
            url: opts.url,
            data: param,
                                async:false, Huh Huh Huh
            dataType: 'json',
            success: function(data){
               success(data);
            },
            error: function(){
               error.apply(this, arguments);
            }
         });
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 07, 2015, 07:26:48 PM »

The 'loader' function allows you to define how to load data from remote server, please try the code below:
Code:
$('#cc').combobox({
loader: function(param,success,error){
var opts = $(this).combobox('options');
if (!opts.url) return false;
$.ajax({
type: opts.method,
url: opts.url,
data: param,
async: false,
dataType: 'json',
success: function(data){
success(data);
},
error: function(){
error.apply(this, arguments);
}
});
}
})
Logged
azizkhani
Newbie
*
Posts: 37


View Profile Email
« Reply #2 on: May 08, 2015, 03:08:39 AM »

thanks alot for help me for this question and others.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!