DaltonPimmel / flexigrid

Automatically exported from code.google.com/p/flexigrid
0 stars 0 forks source link

Event "onSuccess" does not occur if (total == 0). But this is the proper empty set. #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When grid load dataset, if (total==0) we lost call "onSuccess".
I propose add call "onSuccess" in special block of code for (total==0). Because 
this is the correct empty set, as stated here:
http://groups.google.com/group/flexigrid/msg/fa225a8a47fa8ed1

addData: function (data) { //parse data

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.onSuccess) p.onSuccess();
    return false;
}

PS. I attach my full patch and result flexigrid.
This patch includes bug fixes and some improvements specified in Issues:
http://code.google.com/p/flexigrid/issues/detail?id=4#c4
http://code.google.com/p/flexigrid/issues/detail?id=19
http://code.google.com/p/flexigrid/issues/detail?id=20
http://code.google.com/p/flexigrid/issues/detail?id=21
http://code.google.com/p/flexigrid/issues/detail?id=22

Original issue reported on code.google.com by ymkin....@gmail.com on 25 Mar 2011 at 10:48

Attachments:

GoogleCodeExporter commented 8 years ago
I downloaded the patch, and it did not work. The Flexigrid stayed in 
'Processing, Please Wait...' and never displayed the data, but the php file was 
successfully contacted and results returned, so there is something in the 
jquery preventing it from displaying. Then Firebug gave this error message: 
"uncaught exception: [Exception... "Component returned failure code: 0x80040111 
(NS_ERROR_NOT_AVAILABLE) [nsIDOMNSDocument.activeElement]"  nsresult: 
"0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: _js/jquery.js :: 
anonymous :: line 16"  data: no]
Line 0"

Original comment by kro...@wwtele.com on 21 Apr 2011 at 5:22

GoogleCodeExporter commented 8 years ago
I think you've done something wrong. Try modern flexigrid-1.1. This patch was 
not included in this version.
For comparison, try the attached files with this change.

Original comment by ymkin....@gmail.com on 24 Apr 2011 at 4:53

Attachments:

GoogleCodeExporter commented 8 years ago
@ymkins: I just tried it with that javascript file you attached to your comment 
and it worked just fine. Is there something different with that file than with 
the one attached to the issue? I don't know what I would have done wrong, but 
if I did do something wrong - it works now. Thank You!

Original comment by kro...@wwtele.com on 24 Apr 2011 at 8:55

GoogleCodeExporter commented 8 years ago
@kroche: There is a difference, as noted in the release notes ver.1.1 - 
correction for Prototype.js 
[https://code.google.com/p/flexigrid/issues/detail?id=15]

Original comment by ymkin....@gmail.com on 26 Apr 2011 at 6:56

GoogleCodeExporter commented 8 years ago
same problem here, any fix?

Original comment by the...@gmail.com on 11 Oct 2013 at 3:01

GoogleCodeExporter commented 8 years ago
oh I replaced my flexigrid version with flexigrid-1.1.0-y.js  and it worked. 
thank you

Original comment by the...@gmail.com on 11 Oct 2013 at 3:05

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I added the call to fire the onSuccess function at the top of addData:

            addData: function (data) { //parse data
                if (p.onSuccess) {
                    p.onSuccess(this);
                }

Sure it fires twice but I'm ok with it.

Original comment by jbermanw...@gmail.com on 16 Oct 2014 at 6:05