Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Hint to speed up updates
Thu, Mar 23 2023 8:45 PMPermanent Link

erickengelke

Avatar

I don't have a problem, but just an observation.

Sometimes you will have a LOT of data in a TDataset on your web client and want to do bulk operations and may find the app sluggish.  Don't despair.

For example, you may want to calculate an average, or maximum or want to set a new field such as an Image/icon if a field is set a certain way for the primo user experience.

Oh, another good reason is that there are few GOOD ways to set colours of cells in TGrids that also survive user sorts.  A good EASY way is to set a secondary HTML-type field that the client applicaiton can set from server data that can contain colours as well as text, images, etc.

The easiest way to do all these things is to cycle through the TDataset after loading from the server and setting the new field.  

But if you have a large TDataset with, say, 10,000 or 20,000 items, it will be slow because every update causes EWB to want to inform your TGrid and other components on each change.   It can easily take 10 second or more, or even cause timeout warnings.

Or you may use it if you wish to create a subset TDataset based on search criteria as the user is typing.

The trick is to call. dataset.DisableControls before cycling through them, and then call dataset.EnableControls when you are done your processing.  It will be super fast, usually almost instantaneous if you optimize your code!

Hopefully those tips help someone.

Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
Image