#1 2012-09-10 13:02:52

noobies
Member
Registered: 2011-09-13
Posts: 139

How combine FM2 Grid and mORMot?

FireMonkey 2 have TGrid component and TMS create TTMSFMXGrid.
What's the easiest way to display the data through mORMot Framework?

Offline

#2 2012-09-10 13:42:42

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

Re: How combine FM2 Grid and mORMot?

I did not get XE3, nor FM²...
So I can't directly help with it.

You can define the grid in virtual mode, then use TSQLTableJSON.GetCaption() for Row=0, i.e. field name, and GetString()/GetDateTime() and such for the cells data.
See how TSQLTableToGrid is implemented in unit SQLite3UI: it is for a VCL TDrawGrid in virtual mode, so could be re-used for any other virtual grid.

Offline

#3 2012-09-11 06:41:38

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

Re: How combine FM2 Grid and mORMot?

On second thoughts, you may be also interested by the conversion of a mORMOt TSQLTableJSON result set into a standard TDataSet.
I suspect your grid is able to link directly to it.
See http://blog.synopse.info/post/2012/06/2 … t-or-SynDB

Another possibility could be to use live bindings, in XE3.

Offline

Board footer

Powered by FluxBB