[Lazarus] db grid/dataset components that only load currently visible records?
Luca Olivetti
luca at wetron.es
Thu Feb 23 16:09:20 CET 2023
El 23/2/23 a les 13:52, Michael Van Canneyt via lazarus ha escrit:
>
>
> On Thu, 23 Feb 2023, Luca Olivetti via lazarus wrote:
>
>> El 23/2/23 a les 11:11, Michael Van Canneyt via lazarus ha escrit:
>>> But IMO: in the first place you should ask yourself if displaying
>>> 10.000 records is
>>> what you actually want to do.
>>
>> No, I just need to display 20 or so records, the problem is I'd like
>> the user to be able to scroll over the whole table, so I'd have to
>> hook a lot of events in the TDBGrid (if that's even possible,
>> otherwise I'd have to implement a replacement) and get rid of the
>> TDBNavigator and implement a custom one in its place.
>
> The LCL could do with a pager component. Seems to be standard when Web
> pages
> display grids/tables, so users should be used to it :-)
Even if such a component existed, I don't think it would fit my use-case.
Maybe I should just write a TDataset descendant tailor made for this
application, any pointer on how to write a minimal descendant?
I'm looking at the TMemDataset implementation as an example, is it a
good one?
The idea is to substitute open and scrolling (next/prior/locate/etc.)
with the appropriate sql statements to just retrieve a small buffer of
data around the current record (I can do that easily enough), though I'm
not sure that would be enough to fool the TDBGrid.
Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007
More information about the lazarus
mailing list