EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: WeberJ65 on March 20, 2012, 11:47:38 PM



Title: Select the way ajax loads data
Post by: WeberJ65 on March 20, 2012, 11:47:38 PM
Hallo,

i have seen in the Quellcode that some plugin allocate the way ajax loads data (synchronously or asynchronously). For the combotree plugin (depending on combobox) i can select the method-flag but not the async-flag. (Seen screenshot). At my application i must block the brower while the request ist active. How can i set this parameter for the combobox-plugin?

many thanks
Joachim


Title: Re: Select the way ajax loads data
Post by: WeberJ65 on March 22, 2012, 01:09:48 AM
Hallo together,

i found a solution to send the absend paramter "async".(Code above)
A second problem i found is to transmit some Data to the server with post-method. The option parameter "data" do not work correctly. It's always set to an empty object
Code:
9449 _6dd=_6dd||{};
The Variable _6dd has never become a value. I modify the code like this:
Code:
function _6db(_6dc,url,_6dd,_6de){
//New Code insert by j.w. 2012.03.22
var _6xx = null;
//End new Code insert by j.w. 2012.03.022
var opts=$.data(_6dc,"combobox").options;
if(url){
opts.url=url;
}
if(!opts.url){
return;
}
//Old original Code
//_6dd=_6dd||{};
//$.ajax({type:opts.method,url:opts.url,dataType:"json",data:_6dd,success:function(data){
//END old original Code

//New Code insert by j.w. 2012.03.22
_6xx=opts.async?true:false;
_6dd=opts.data||{};
$.ajax({type:opts.method,async:_6xx,url:opts.url,dataType:"json",data:_6dd,success:function(data){
//End new Code insert by j.w. 2012.03.022

_6d6(_6dc,data,_6de);
},error:function(){
opts.onLoadError.apply(this,arguments);
}});
};

Developer i hope it's o.K. and you can clear this bug in any of the next version.

Many regards
Joachim