tags:

views:

217

answers:

1

I have a jqgrid whose html is displayed in the following way.

I build this myTable as a jqgrid using some custom javascript. This was working fine for a long time.

I made a change to collapse(in simple terms to hide) the div "tableSectionDiv" when the grid does not have any records.

In order to do this, on the grid complete event I computed,

var r = jQuery("#myTable").getGridParam('reccount');

if(r == 0) { $("#tableSectionDiv").hide(); }

there by collapsing the div. There is a button which will show the div with a simple $("#tableSectionDiv").show(); code

But when I see the grid it displays the empty grid, But I SEE THE LOADING IMAGE WITH NO TEXT IN IT.

Any idea on why it is happening?

+1  A: 

You should post the code which reproduce the problem. In another example http://www.ok-soft-gmbh.com/jqGrid/GetScheduledReleases1.htm I hide table immediately after loading (independent on the number of rows having). With "Show Grid" button one can show the grid and with "Refresh" button from the navigator, with the sorting of any column or with the button "Hide Grid" one could hide the grid. No problems with the "LOADING IMAGE WITH NO TEXT IN IT" I can not reproduce.

Oleg
@Oleg - I see what you are saying. I saw the code source of the link that you sent me. The grid in the page had records and show or hide works properly. But if the grid does not have any records, then after binding you should hide the sameway as you do it.Then again using the button try to show it and see if you can just see the empty grid or an empty grid with a Loading DIV with no text on it.Let me know. My code is a kind of splitted up but works the exact sameway as you showed me. So try to hide an empty grid and then show it using the button and see how it looks.
SARAVAN
I modified the example, see http://www.ok-soft-gmbh.com/jqGrid/GetScheduledReleases2.htm and can not reproduce your problem also with the empty grid.
Oleg
Your answer was quite useful in general in the way you explained. But I guess my my grid has been reused in a complex way in my aspx controls and thats why I see the "LOADING IMAGE WITH NO TEXT IN IT" when I hide a div that contains this grid.But I fixed my problem by just hiding the Div that shows "LOADING IMAGE WITH NO TEXT IN IT" using $("#load_<your table name for grid").hide();that collapses "LOADING IMAGE WITH NO TEXT IN IT", when I hide or show the Div containing the empty grid.But thanks for your answer. Yours is accepted answer in the way you explained with the sample.
SARAVAN