Opened 9 years ago

Closed 6 years ago

#11306 closed defect (patchwelcome)

treegrid's defaultOpen="false" not working properly

Reported by: Jean-Rubin Leonard Owned by: Bryan Forbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.5.0b2
Keywords: treegrid defaultOpen="false" expand Cc:
Blocked By: Blocking:

Description

Hi, actually the rows of the treegrid start collapsed. That works ok. When we try to expand the collapsed rows however nothing happens. The code for the online tests work ok (I verified) but with the provided data, the problem can be reproduced. Two files are attached, the test case itself and the .json file that contains the test data.

Attachments (3)

treegrid.html (1.8 KB) - added by Jean-Rubin Leonard 9 years ago.
gamedata.json (359 bytes) - added by Jean-Rubin Leonard 9 years ago.
tree.js (2.5 KB) - added by devinjones 8 years ago.
Corrected tree.js for 1.5.0

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by Jean-Rubin Leonard

Attachment: treegrid.html added

Changed 9 years ago by Jean-Rubin Leonard

Attachment: gamedata.json added

comment:1 Changed 9 years ago by bill

Component: GeneralDojoX Grid
Owner: changed from anonymous to bryanforbes

comment:2 Changed 9 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

Changed 8 years ago by devinjones

Attachment: tree.js added

Corrected tree.js for 1.5.0

comment:3 Changed 8 years ago by devinjones

The problem seems to be that dojox.grid._Expando.setRowNode() is closing the expando after it is opened. This is because dojox.grid.cells.TreeCell?.getOpenState is using the default state (open=false) for the rowId and not looking for the rowId in the list of openStates. It does this because line 28 of dojox/grid/cells/tree.js (dojo 1.5.0) tests if the typeof itemId is a string. It is actually a number. Here is the corrected code:

if((typeof itemId != "string" && typeof itemId != "number") || !(itemId in this.openStates)){

I just joined so I don't know if this is the right way to submit a patch. I will find out and get it submitted.

Devin

comment:4 Changed 8 years ago by james_cantwell

Bump - I see this behaviour in 1.5 as well

comment:5 Changed 6 years ago by bill

DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.

You should upgrade your code to use one of those two grids.

We will consider patches to the old DojoX Grid code though.

comment:6 Changed 6 years ago by bill

Resolution: patchwelcome
Status: newclosed
Note: See TracTickets for help on using tickets.