-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm developing a client side calculation on the grid component. But when the grid has more than 20 rows, after the 20, RowIterator returns the Row object, it's not null, but it says it has only one child, but the grid has 6 columns, and are visible on the browser.
I've tried setting preloadSize (on server), rerendering the row (on client) renderAll (on server), and now I've got no clue how to make this works.
Ok,
I got it. It's a execution sequence mistake. The execution sequence is:
1. AfterCompose on composer
2. Data binding model="composer.listMethod"
3. Grid onCreate method.
Apparently setting preloadSize has no effect on client side. Calling grid.renderAll() on 2 also has no effect (after setting the model). Calling renderAll() on 3 solved.
Now, to the next problem,
The above situation only works when 1st drawing the page. If I trigger a update on the grid model (let's say by a button), then I don't have the grid.onCreate event anymore, and I can't imagine any other event so I can call grid.renderAll() and make this work.
Any tips on this?
Thanks,
Madruga
Hi
I have a small question, why do you need to know how many columns inside a row?
I am thinking the problem you mention, because the row is not visible to user, so, it doesn't have child components
so how about make the row object to visible first? does this behavior is has side effect to you ??
Hi Sam,
Thanks for the quick reply.
Well, the basic idea is that I'm calculating the total value, that's why I need to iterate on every row. (and it recalculates on every onChange event form a lot of components inside the grid)
I've checked if was the visible problem, that's why I setted preloadSize to the same amount of rows that will be generated (29). I also checked the _visibleItemCount on Rows.js, it had 29 on it. I even made a test changing my browser screen size, to show all the itens in the browser without scrooling, and still, 21~29 rows were empty. With "empty" I mean that the Row widget is not null but has only one child (should have 6), but the HTML is displayed with the correct data (all 6 columns populated), quite strange huh?!
Could be a bug?
I believe that's because data binder is on the way, if I could force a grid.renderAll() after the data binder setted up the rows, would probably solve this issue.
Hi,
It definitely has something to do with data binding. I've switched the impl from databind to RowRenderer.
updating the model with setModel() has the same behaviour, 21~29 Row Widget is empty.
But then calling grid.renderAll() forces the render on all rows, then it work as expected.
For now I'll go with RowRenderer, but it would be nice if we could force a renderAll after data binder has done it's magic.
Kind regards,
Madruga
Asked: 2010-03-21 15:42:22 +0800
Seen: 755 times
Last updated: Mar 22 '10