Opened 12 years ago

Last modified 6 years ago

#9869 closed enhancement

Tree: option to temporarily disable UI updates — at Version 4

Reported by: Icannon Owned by:
Priority: low Milestone: 1.13
Component: Dijit Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Add an option to the Tree to temporarily disabled UI updates for efficiency when making many (individual) updates to the data store.

Original description: I have a change to submit for ItemFileWriteStore?.js

This improves newItems refreshes in the dojo dijit tree. Instead of having the tree update and refresh the display for each newItem call it can do this once every 50 or even 100 calls.

Change History (5)

Changed 12 years ago by Icannon

Attachment: ItemWriteStore.js added

Changed the itemWriteStore.js to control newItem notification.

comment:1 Changed 12 years ago by Icannon

If you are adding several thousand items to the dojo dijit tree store then the tree has to refresh for each node which slows down the tree and requires a user to prompt if they want to continue the script. This is much worse in internet explorer.

This is an example of a dijit tree call for the optimized item write store.

This is a kind of optimization... we only refresh the tree when it's the last node added. This way, we don't spend a lot of time refreshing the nodes from 1 to N when all that is needed is that last node to be refreshed to update the tree. This adds an extra parameter to the dataStore object called "noRefresh" which does not do a refresh if the value is true. if (i == (numberChildren-1)) {

childItem = dataStore.newItem(newItemProps, parentItemProps, 0);

} else {

childItem = dataStore.newItem(newItemProps, parentItemProps, 1);


comment:2 Changed 12 years ago by bill

Component: GeneralData
Owner: changed from anonymous to Jared Jurkiewicz

Hmm, I'm doubtful that we want to change the store to add an extra parameter. Let's see what Jared thinks. I do see the problem you are talking about though. It seems like maybe you'd want a parameter to tree, although it's probably best to just somehow turn off the tree and then refresh the whole tree after the data store has changed.

Also, who are you? You are registered as Uil Uil. We need a CLA filed before we can accept patches, and then they should be in patch file format, thanks!

comment:3 Changed 12 years ago by Jared Jurkiewicz

I don't like this as it's not part of the datastore spec. The spec states when a new item is added, an event is fired. I think it would be better to have the tree be able to disable UI uopdated for a period, then re-enable them. Grid has such a parameter, where it will disable any refreshing until so desired to re-enable it. Specifically for cases where lots of changes occur to the underlying data in one shot.

comment:4 Changed 12 years ago by bill

Component: DataDijit
Description: modified (diff)
Milestone: tbdfuture
Owner: Jared Jurkiewicz deleted
Summary: itemwritestore improvement to control refresh notificationTree: option to temporarily disable UI updates
Type: defectenhancement

OK, I'm changing this to a ticket to be able to temporarily disable UI updates in the Tree.

Not sure I'm crazy about that idea, but I'll leave it in this ticket to consider.

Note: See TracTickets for help on using tickets.