I want to override the loader function globally. What is the better way to do it?
$('.easyui-treegrid').each( function() {
$(this).treegrid({
loader:function(param,success,error) {
// my loader code
}
});
});
or like this:
$.fn.combobox.defaults.loader = function(param, success, error) {
var opts = $(this).combobox('options');
if (!opts.url) return false;
bsSendRestRequest(opts.url, param, null, success); // my own loader method
};
I noticed, that for dynamic items, e.g. combobox in a propertygrid, only the second variant is working. But I don't know, if there is any tradeoff.
Or is there another way to do it?
cu Christian