Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12914 closed defect (fixed)

LazyTreeGrid removes extra items when collapsing a node.

Reported by: anandn@… Owned by: evan
Priority: high Milestone: 1.7
Component: DojoX Grid Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:

Description

LazyTreeGrid? removes extra items when collapsing a node. The cleanChildren function in dojox.grid.TreeGridItemCache? removes some of its siblings as well, in addition to its children.

if(this.items[i].treePath.indexOf(treePath) === 0 && this.items[i].treePath !== treePath){

this.items.splice(i, 1);

}

Shouldn't this be

if(this.items[i].treePath.indexOf(treePath+"/") === 0 && this.items[i].treePath !== treePath){

this.items.splice(i, 1);

}

For example if there are 15 nodes at the top level, expanding and then collapsing node 1, removes items with tree path 10, 11, 12, 13, 14 and 15 which are siblings of the node with tree path 1 (the node being collapsed).

Change History (4)

comment:1 Changed 9 years ago by anandn@…

An update... The problem seems to happen when there are only few items in the grid. I tried with more than 100 items at level 0 and level 1 and 2 has 1000 items. In this case when opening and closing item with tree path "1", the cleanChildren node removes the items with treepath starting with 1, but those items are being fetched again. But when there are only a few rows, the items at level 0, with tree path starting at "1" are removed, but are not fetched again.

Is it necessary to remove these extra items, if all is needed is to remove the children of the node being collapsed?

Anand

comment:2 Changed 9 years ago by bill

Component: GeneralDojoX Grid
Owner: set to evan

comment:3 Changed 9 years ago by evan

Resolution: fixed
Status: newclosed

(In [25478]) Fixes #12914, thanks for the fix from anandn

comment:4 Changed 9 years ago by evan

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.