Fix to prevent lock when grid can't load data

65 views
Skip to first unread message

JaiQ

unread,
Oct 24, 2008, 4:59:11 AM10/24/08
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.

David Lindsey

unread,
Nov 7, 2011, 2:36:19 AM11/7/11
to flex...@googlegroups.com
As this amendment was posted some time ago (2008), are these changes still applicable as I still have this problem with v1.1 or is there a more up to date and fixed version?
thanks is advance
David
Reply all
Reply to author
Forward
0 new messages