Discussion:
[Dojo-interest] DataGrid events firing oddly
Karl Tiedt
2010-10-01 20:17:50 UTC
Permalink
Hopefully there is a simple solution for this, nothing I thought would
work did... basically I have a DataGrid that uses onAfterRow (to avoid
formatter() x r*5 being called) to format the contents of specific
cells of each row...

The problem is, the grid is center region of a BorderContainer,
rowsPerPage = 25 (default IIRC) and onAfterRows (and even using a cell
formatter) STOPS at the 25th row... despite there being more on the
page (high resolution) is there a quick fix for this besides just
upping the rowsPerPage since that just hides the problem a little
better?

-Karl Tiedt
Karl Tiedt
2010-10-01 21:18:17 UTC
Permalink
I just figured out that the formatters are stopping at page breaks...
grid.scroller.pageNodes lists each page and the divs perfectly
highlight this fact... is this expected behavior?

its 1.4.3 which I forgot to mention (and cc'ing dev list since I found
the above out)

-Karl Tiedt
Post by Karl Tiedt
Hopefully there is a simple solution for this, nothing I thought would
work did... basically I have a DataGrid that uses onAfterRow (to avoid
formatter() x r*5 being called) to format the contents of specific
cells of each row...
The problem is, the grid is center region of a BorderContainer,
rowsPerPage = 25 (default IIRC) and onAfterRows (and even using a cell
formatter) STOPS at the 25th row... despite there being more on the
page (high resolution) is there a quick fix for this besides just
upping the rowsPerPage since that just hides the problem a little
better?
-Karl Tiedt
Evan
2010-10-02 07:13:44 UTC
Permalink
Hi Karl,

Just had a quick try with v.1.5 and v.1.4.3, seems it's working for me with
following steps:
1. Use dojox/grid/tests/test_grid_layout_borderContainer.html
2. Add onAfterRow, e.g.
gridLayout = {
...
onAfterRow: afterRow,
...
};

function afterRow(rowIndex, cells, rowNode){

dojo.query('td',rowNode).forEach(function(node){dojo.style(node,
{backgroundColor:'green'});});
}
3. Change row number to 600 - dojox/grid/tests/support/test_data.js
var rows = 600;

Then the style customization is applied to all rows.

Guess some special stuff I missed to reproduce the issue?

- Evan
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/DataGrid-events-firing-oddly-tp1616841p1618930.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
Karl Tiedt
2010-10-04 16:52:31 UTC
Permalink
There are some filter calls to a QueryReadStore and it seems that the
start index may not always be properly being updated so query is
firing with start: 0 when it shouldnt be.... so may be a QRS issue,
not a Grid issue

-Karl Tiedt
Karl Tiedt
2010-10-04 17:46:01 UTC
Permalink
We just noticed this new information:
on initial grid loading, the QRS is polled twice, start: 0,
count: 25 then start:25, count 25

when we provide a filter call, QRS only polls once... start: 0, count: 25

This could be our problem but I cant seem to find any code that would
be firing the 2nd poll on load, would this be Grid or QRS feature?
*puzzled*

-Karl Tiedt
Jared Jurkiewicz
2010-10-05 00:09:55 UTC
Permalink
Grid decides how many pages to load based on the return from QRS. If
QRS returns only 25 that match (or less for numRows), then it wouldn't
try to grab 25 more, and so on.

-- Jared
    on initial grid loading, the QRS is polled twice, start: 0,
count: 25 then start:25, count 25
    when we provide a filter call, QRS only polls once... start: 0, count: 25
This could be our problem but I cant seem to find any code that would
be firing the 2nd poll on load, would this be Grid or QRS feature?
*puzzled*
-Karl Tiedt
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Evan
2010-10-05 02:29:04 UTC
Permalink
Yes, it's Grid behavior, if nothing configured, Grid will require a minimal
number of rows to fill Grid viewport(the initial number 50 == 25 rowsPerPage
* 2), and has a maximal number 75(keepRows), the fetching occurs at
DataGrid._fetch() ...

Not sure if any paging parameters changed in your case? e.g.
Grid.keepRows/rowsPerPage

- Evan
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/DataGrid-events-firing-oddly-tp1616841p1633755.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
Loading...