Forum


19:41

31/03/2011

(function($){
$.jgrid.extend({
hashcontrol : function(p) {
p = $.extend({
active : true
},p || {});
this.each(function(){
this.hash = true;
var ts = this;
var dt = ts.p.datatype.toLowerCase();
$.ajax($.extend({
url:ts.p.url,
type:ts.p.mtype,
dataType: dt ,
data: $.isFunction(ts.p.serializeGridData)? ts.p.serializeGridData.call(ts,ts.p.postData) : ts.p.postData,
complete: function(res,status) {
alert("123″);
}
}, $.jgrid.ajaxOptions, ts.p.ajaxSelectOptions || {} ));
});
}
});
})(jQuery);
I`m trying to write a plugin, but i`t doesn`t wort. Where am i wrong?
Or is there any way to get loadComplete, gridComplete events?
jqGrid 3.8.2
jQuery 1.51
18:41

31/03/2011

hashcontrol : function(p) {
p = $.extend({
active : true
},p || {});
var self = this;
return this.each(function(){
this.hashcontroller = true;
var loadComplete = this.p.loadComplete;
var prop = this;
/*rebind default loadComplete event*/
prop.p.loadComplete = function(){
alert("feel!"); // my function
if($.isFunction(loadComplete)){
loadComplete.call();
}
};
});
}
By this way i can modify default events, but it works after ajax request sended i there any way to solve this problem?
Most Users Ever Online: 715
Currently Online:
50 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66