PDA

View Full Version : liveGrid displayed row amount



kwasek
29 Jan 2010, 5:50 AM
Hi,
is there a way to set amount of displayed rows in live grid?

CODE:

Grid<ModelData> grid = new Grid<ModelData>(store, cm);
grid.setTrackMouseOver(false);
grid.setBorders(true);
grid.setAutoExpandColumn("nazwa");

//grid.getSelectionModel().setLocked(true);

LiveGridView liveView = new LiveGridView();
liveView.setEmptyText("No rows available on the server.");
liveView.setRowHeight(32);


grid.setView(liveView);
grid.setBorders(true);
grid.setStripeRows(true);
grid.setHeight(545);

I set the height of the grid to 545, which should take more than 20 rows. I don't know why grid is displaying only 15 rows. I can scroll down and up , but it's only showing 15 rows. cache is set to standart 200. no other settings are set

wm003
29 Jan 2010, 7:12 AM
Well, if you define the gridheight to 545 and the rowheight to 32 (like you did in the example code) there is simply

545 / 32 = 17

in fact you need to substract about 40 pixels from the 545 height as it's used by the gridheader. At least livegrid calculates correctly around 15 visible lines

kwasek
29 Jan 2010, 8:31 AM
Yes, you were right. But no t exactly. I deleted row height setting , and my problem disappeard. Second strange thing is that setting oh row height didn't work.

So the problem is PARTLY SOLVED

terciofilho
29 Jan 2010, 11:05 AM
You are wrong.

When you set the row height in the LiveView, it will use that value to calculate how many rows it will display, regardless the real row height

The default row height is 20.

Take a look at LiveGridView implementation, your answer is there.