#1 2013-04-03 20:03:03

chapa
Member
Registered: 2012-04-30
Posts: 117

TSQLTable Sort

Can I request a TSQLTable feature.
It would be really good if one be able to sort using multiple fields in asc/desc order.

Offline

#2 2013-04-03 20:12:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: TSQLTable Sort

You have the sorting already implemented at TSQLTable level, but for one field.

See TSQLTable.SortFields() method.
BTW, this method is very optimized for speed, since it is the one used at mORMot UI grid level for sorting its content.

Is it really not enough?

Offline

#3 2013-04-03 20:37:20

chapa
Member
Registered: 2012-04-30
Posts: 117

Re: TSQLTable Sort

Hi ab,

Yes, I already use sorting by one field index. It is pretty fast.
I use to store arbitrary TSQLRecords (not fully coming from sql database) in TSQLTable and return its json content.
But usually, common data is needed sorted by multiple fields, just like you expect if it is coming from sql-like storage (but in my case it is not).

Offline

#4 2013-04-04 08:18:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: TSQLTable Sort

I've created a ticket for this feature request.

See http://synopse.info/fossil/tktview?name=d277153f03

Offline

#5 2013-04-09 14:05:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: TSQLTable Sort

We have just added TSQLTable.SortFields() overloaded method, able to sort a TSQLTable row content by multiple fields - implements your feature request.
Includes regression tests.

See http://synopse.info/fossil/info/38cd41ff85

Hope it helps.

Offline

#6 2013-04-09 14:46:14

chapa
Member
Registered: 2012-04-30
Posts: 117

Re: TSQLTable Sort

That is great, ab.
Thanks a lot, definitely will help.

Offline

Board footer

Powered by FluxBB