JaiQ
unread,Oct 24, 2008, 4:59:11 AM10/24/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Flexigrid for jQuery
Hi all,
When flexigrid makes an AJAX request and an error occurs during this
request, its interface stays blocked and "processing please wait..."
message stays on status bar forever. There is no way other than
refreshing whole page to unlock the grid again. I did some simple
modifications to prevent this behaviour, and wanted to share here for
those who are affected by same issue. Use it at your own risk.
Find following line in flexigrid.js:
procmsg: 'Processing, please wait ...',
Replace it with:
errormsg: 'Error occured while populating data!',
procmsg: 'Processing, please wait ...',
This adds the default for customisable load error string in grid
parameters.
Then find following block:
$.ajax({
type: p.method,
url: p.url,
data: param,
dataType: p.dataType,
success: function(data){g.addData(data);},
error: function(data) { try { if (p.onError) p.onError(data); }
catch (e) {} }
});
And replace it with:
var self = this;
$.ajax({
type: p.method,
url: p.url,
data: param,
dataType: p.dataType,
success: function(data){g.addData(data);},
error: function(data) {
try {
if (p.onError)
p.onError(data);
} catch (e) {}
$('.pPageStat',this.pDiv).html(p.errormsg);
$('.pReload', self.pDiv).removeClass('loading');
self.loading = false;
if (p.hideOnSubmit) $(g.block).remove();
self.hDiv.scrollLeft = self.bDiv.scrollLeft;
if ($.browser.opera) $(t).css('visibility','visible');
}
});
Use it at your own risk, hope it helps.