Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Grid becomes read only when no data returns via json
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marcos  
View profile  
 More options Feb 7, 9:33 am
From: Marcos <mcf...@gmail.com>
Date: Tue, 7 Feb 2012 06:33:46 -0800 (PST)
Local: Tues, Feb 7 2012 9:33 am
Subject: Grid becomes read only when no data returns via json
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ymkin mir  
View profile  
 More options Feb 7, 2:49 pm
From: ymkin mir <ymkin....@gmail.com>
Date: Tue, 7 Feb 2012 21:49:14 +0200
Local: Tues, Feb 7 2012 2:49 pm
Subject: Re: Grid becomes read only when no data returns via json
You may use flexigrid version from this topic:
http://code.google.com/p/flexigrid/issues/detail?id=25

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »