Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#12220 closed defect (invalid)

Setting scrollToRow leads to an incorrect row position

Reported by: Eric Pasquier Owned by: Bryan Forbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.5
Keywords: scrollToRow Cc:
Blocked By: Blocking:

Description

When the height of a row is bigger than one line (in case of a long string or if you place an image in the cell), setting scrollToRow leads to a wrong row.

The example attached show a grid with 100 rows, and a button to set the position to the last row.

If you press the "Goto end" button, the list doesn't go to the last row. If you press it one more time, it does.

When you reload the page, the position is memorized in a cookie and the page is reloaded. When the page is reloaded, it set the position of the table to the old value. In this case, it doesn't go to the correct row.

If you activate the useTimeOut flag, a second call to scrollToRow is made after a timeOut (100ms here), which correct the position. It seems that during the first call, the default page height is used during the calculation of the pagination.

This problem is present in 1.5 and not corrected in 1.61b

Attachments (1)

testgrid16d.htm (3.2 KB) - added by Eric Pasquier 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Eric Pasquier

Attachment: testgrid16d.htm added

comment:1 Changed 8 years ago by Bryan Forbes

Owner: changed from bryanforbes to Bryan Forbes

comment:2 Changed 8 years ago by Bryan Forbes

Resolution: invalid
Status: newclosed

This is not a bug, but a known limitation of the grid. scrollToRow is based on an average of row heights because not all of the rows in the grid are rendered. The grid makes a best guess for variable height rows.

comment:3 in reply to:  2 Changed 8 years ago by Eric Pasquier

In this case, can you please explain to me why it is working after a 100ms timeout for example ?
I think I have the response: the grid has fisnished to load the rows from the store and can calculate the real height.
Can you then force the grid to load the rows, if it isn't, in the scrollToRow function ? Eric.

comment:4 Changed 8 years ago by Eric Pasquier

Or add a parameter to the function : scrollToRow(forceFetch), defaulted to false for backward compatibility ?

Note: See TracTickets for help on using tickets.