PDA

View Full Version : Grid Size and Scrolling Questions



Crocuta
20 Apr 2011, 10:53 AM
Hey everyone,

I'm running into some problems with sizing my grid and scrollbars.

I'll show the code first I suppose. Here's the grid:


var simpleGrid = new Ext.grid.EditorGridPanel({
store: store,
columns: mycolumns,
layout:'fit',
autoScroll:true,
overflow:'auto',
stripeRows:true,
autoHeight:true,
width:'1000px',
columnLines:true,
title:'Forecast',
renderTo:'formDiv'
});

And the html:


<div>
<div id="formDiv"/></div>
</div>

I'm not attempting to limit the height at all atm because when I do it only displays one row. I can scroll through the rows with the mouse wheel but only ever one row is being displayed. The width, however, doesn't have that issue.

The big issue I'm having right now is that I can't get scrollbars to appear (Horizontal or vertical). I can get one for the div but then the headings disappear, unfortunately. Like I said, I can get the width to limit correctly but columns that are outside of the width get cut off.

I've also been getting an error in firebug. As far as I can tell it isn't actually affecting anything and all related posts about this error seem to not really apply here. The error is "b is null" on line 7 of ext-all.js.

I've attached the code that I believe is relevant. Let me know if you guys have any questions.

Thanks!

arthurakay
20 Apr 2011, 12:11 PM
First of all, you should be using ext-all-debug.js when you're developing. The error message you'll see will be much more helpful.

Second, you shouldn't need to define a layout on the grid... remove "layout: 'fit'" from your config and see what happens.

Unless I'm blind, I also don't think "overflow: auto" is a valid config option. Remove that too.

Crocuta
20 Apr 2011, 12:24 PM
Alright, I've included the debug.js. It makes it so that firebug doesn't return any js errors so I'm assuming that I need to look at the debug output through some other means?

I've removed layout and overflow but no effect. I think that the reason I added those two in the first place was desperation.

I'll see if I can figure out ext-all-debug.js for the moment.

arthurakay
20 Apr 2011, 12:32 PM
Use ext-all-debug.js instead of ext-all.js

Crocuta
20 Apr 2011, 12:54 PM
Cool, I got debug going "ct is null" on line 10978:
ct.dom.insertBefore(this.el.dom, position);

I'm not really sure what happened but I tried implementing groups, reverted the changes, and now I have scrollbars :D .

As far as I know that error isn't actually doing anything negative. Just strange.

arthurakay
21 Apr 2011, 6:09 AM
It's possible that some code in your columns config is causing that error... you didn't post that.

If you've gotten things working, then that's a step in the right direction. Let me know if you're still experiencing problems.