The simplest way to solve this issue is to setup the parameters globally.
$.ajaxSetup({crossDomain: true, xhrFields: {withCredentials: true}});
You also can override the default loader function of the datagrid component.
$.extend($.fn.datagrid.defaults, {
loader: function(param, success, error){
var opts = $(this).datagrid('options');
if (!opts.url) return false;
$.ajax({
type: opts.method,
url: opts.url,
xhrFields: {withCredentials: true},
data: param,
dataType: 'json',
success: function(data){
success(data);
},
error: function(){
error.apply(this, arguments);
}
});
}
})