#1 2014-01-20 15:18:33

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

TDataset.Filter is not implemented?

Hi,
I want to filter on a TDataset that I got from JSONToDataset, but the dbgrid that is connected to this dataset, is not filtering. Am I doing something wrong,
besides filtering on the client side?

So, I have the following:

DBgrid.datasource.Dataset := JSONToDataset(Self, ...);
DBGrid.datasource.filter := 'Firstname="a*"';
DBGrid.datasource.filtered := true;

It this possible with TSynSQLTableDataSet?

Merci,

Wai


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

#2 2014-01-20 16:27:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: TDataset.Filter is not implemented?

You can do it with function JSONToClientDataSet() as defined in unit mORMotMidasVCL, since it uses a TClientDataSet for storage.

But it will be slower than our optimized TSynSQLTableDataSet and its ancestor TSynVirtualDataSet.

I never used Filters with TDataSet, so I'm no expert here.

Offline

#3 2014-01-20 17:45:56

wai-kit
Member
From: Amsterdam, the Netherlands
Registered: 2012-11-27
Posts: 90

Re: TDataset.Filter is not implemented?

Cool. Works like a charm!
I am porting an existing Datasnap application to Mormot and for now it suffices.

Merci beaucoup!!


fpcdeluxe, FPC 3.2 / Lazarus 2.0, mORMot on Windows 10 ...

Offline

Board footer

Powered by FluxBB