Hi all
I've found a ... bug ?
I'm using flexigrid inside jQuery UI tabs
When data comes empty from the server, the grid becomes read only.
Here is the solution:
There is an object (g.block) that makes the grid "blocked" when it
populates, see populate function, and a few lines below you will find
these ones:
if (p.hideOnSubmit) {
$(this.gDiv).prepend(g.block);
}
Well, after this, the ajax call will transfer control to addData
function, the line looks like
g.addData(data)
This function addData removes the "blocker" (g.block) after the data
is placed in the grid, but... if no data is received, the function
ends before the blocker is removed.
A few lines before this one:
changeSort: function (th) { //change sortorder
You will find these:
if (p.hideOnSubmit) {
$(g.block).remove();
}
But over 110 lines above, you can find this block:
if (p.total == 0) {
$('tr, a, td, div', t).unbind();
$(t).empty();
p.pages = 1;
p.page = 1;
this.buildpager();
$('.pPageStat', this.pDiv).html(p.nomsg);
return false;
}
The problem is the "return false". Here ends the function before the
"remover" is executed, so the solution is very easy. Add the "remover"
before the return false. :-)
if (p.total == 0) {
$('tr, a, td, div', t).unbind();
$(t).empty();
p.pages = 1;
p.page = 1;
this.buildpager();
$('.pPageStat', this.pDiv).html(p.nomsg);
if (p.hideOnSubmit) {
$(g.block).remove();
}
return false;
}
I hope this helps
Bye all