andycrespo27 / flexigrid

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

Show/Hide Columns Box #74

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

I am experiencing a problem with the show/hide column drop down.  I am only 
able to show the show/hide column box containing the checkboxes if I manually 
resize the column after the flexigrid loads.  After the flexigrid loads and 
before I manually resize the column it seems like the div is hidden behind the 
table data.

Thoughts?

Original issue reported on code.google.com by jtraina...@gmail.com on 9 Sep 2011 at 6:51

GoogleCodeExporter commented 8 years ago
how to remove the check box show/hide in flexigrid help me.......plz.contact me 
on sabarinathancs@gmail.com

Original comment by sabarina...@gmail.com on 28 Sep 2011 at 4:02

GoogleCodeExporter commented 8 years ago
I am experiencing the same problem of not been able to show/hide column box 
before manually re-sizing it. Any inputs?

Original comment by shankey....@gmail.com on 12 Oct 2011 at 9:37

GoogleCodeExporter commented 8 years ago
i am also facing this problem.. i found the cause of this but not solution.. if 
you set height : 'auto' then its giving this problem and if you set fix height 
then its working properly..

Original comment by pradeepb...@gmail.com on 20 Oct 2011 at 5:37

GoogleCodeExporter commented 8 years ago
there is one solution if you call resize function of flexigrid on load then it 
will work properly...

Original comment by pradeepb...@gmail.com on 20 Oct 2011 at 5:40

GoogleCodeExporter commented 8 years ago
If you want to fix this, the problem is at line 96 of flexigrid.js. 

if (nd > newH) $(g.nDiv).height(newH).width(200);
else $(g.nDiv).height('auto').width('auto');

An if statement that checks if the hide/show menu height 'nd' is greater than 
newH which is set to zero if you set height to 'auto'. If nd is greater than 
newH (which it will be if you set height to 'auto'), nd's height is set to the 
value of newH... 0. This whole test doesn't make sense and in my opinion it. I 
think it should be removed completely, leaving only the following in place of 
the previous two lines.

$(g.nDiv).height('auto').width('auto');

Original comment by mgee2...@gmail.com on 3 Dec 2011 at 7:25

GoogleCodeExporter commented 8 years ago
Removing that line as stated above fixed it!  Thank you for the tip.  You just 
saved me hours of looking through the code.

Original comment by austin.g...@gmail.com on 9 Feb 2012 at 3:15

GoogleCodeExporter commented 8 years ago
Please help me ... mine is a similar issue ... but little different. ...when I 
select height as auto in flexigrid, i get the vertical scroll bars which i dont 
want. As and when i enter the records i want the table height to change so that 
there should be no vertical scroll bars. This happens correctly in firefox but 
not in IE..... please help...

Original comment by sintavin...@gmail.com on 10 Apr 2012 at 2:04

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have found a little bit better behavior for the solution that 
mgee2...@gmail.com described when the flexigrid height is set to 'auto', as his 
solution will cut off the drop down when there are only a couple rows and the 
total set of columns are wide, it would be better to have the scrollbar.

This may only apply to json payloads and "preprocess: true", as the data comes 
in after the call to "fixHeight" which sets up various things like the 
show/hide drop down height.

// OLD CODE
 if (nd > newH) $(g.nDiv).height(newH).width(200);

The first time the table loads and fixHeight is called, newH is calculated as 0 
because the bDiv (your data) is height zero because the json load hasn't 
happened yet, and it then sets nDiv (the drop down) to height zero.  Playing 
with some of the column resizing controls and what not will eventually sort it 
out, but that's not what we want.

I am using the following small hack as a workaround to provides scrollbars to 
the hide/show list, I'll leave it to the author to figure out the best fix:
add an onSuccess configuration in the flexigrid call to call fixHeight()

onSuccess: function() {$(#TABLE ID SELECTOR).each(function() {if (this.grid) 
this.grid.fixHeight();});}

and update the if test on line 95:
if (newH > 0 && nd > newH) $(g.nDiv).height(newH).width('auto');

If you only do the onSuccess, then the first time it's called prior to data 
population, nDiv is size zero and the if test fails, which leaves the height at 
zero for the second onSuccess() that we prompted.

Original comment by plo...@gmail.com on 20 Apr 2012 at 12:35

GoogleCodeExporter commented 8 years ago
Hi

I can confirm that plo...@gmail.com's solution works perfectly

Original comment by scionsol...@gmail.com on 5 Aug 2013 at 2:42