CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

DXE2/IW14 - Sorting Gird + ADODataset

General discussion

by ScottWGast » 13 May 2014 15:03

I'm feeling like a bit of a n00b, but, for the life of me, I cannot get my grid to sort :(

Very simple scenario: TADODataSet + TIWCGJQGrid... I'd like to be able to click the column header to have the grid sort, but the solution is escaping me. I have set each of the columns.Sortable = True, set each of the column's respective .SQLFieldname, the grid.Sortable = True.

I've also set other various properties that seem to have something to do with sorting, but it's still not working. The CG demo shows the column headers with the "sortable" icons that are clickable, but the data in the demo does not actually sort.

TIA for your help.

Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Jorge Sousa » 13 May 2014 15:29

Scott

Check the jQueryDemo_V2, because you've to find a way change the SQL yourself,

We work at dataset level, there is no sort, we pass the Order by items
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by ScottWGast » 13 May 2014 16:14

OK, I've modified the code to update the SQL when a column heading is clicked. Thanks.

Does the property Grid.Column.FirstSortOrder reflect the current SortOrder setting for the column, or does it just reflect the "First" sort order setting? If it's only for the "first" sort order setting, how do I find out the "current" sort order setting for a particular column? I need this setting when updating the SQL in places other than the .OnSortCol event (which passes the sort order).
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Jorge Sousa » 13 May 2014 16:28

FirstSortedOrder it's the initial sort order

You should use newer Grid.OnSort instead of Grid.JQGridOptions.OnSortCol, as is in jQueryDemo_V2
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by ScottWGast » 13 May 2014 18:24

I'm looking at Grid.OnSort and see that TIWCGJQGridSortItems are passed to the event; I've looked at the documentation, but it's not very descriptive as to the contents and functionality of the objects in the TIWCGJQGridSortItems collection.

There are three properties in the TIWCGJQGridSortItem object:
.Name
.Order
.OrderS

Does .Name represent the SQL field name?
Does .Order represent the sort order (TIWCGJQGridSortOrder) for .Name?
What does .OrderS represent?

UPDATE:
I've inspected the TIWCGJQGridSortItem object and it looks like:
.Name = field name
.Order = TIWCGJQSortOrder
.OrderS = string representation of .Order

Correct?

UPDATE 2:
Just found the TIWCGJQGridSortItems.OrderByClause! Yay.
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Jorge Sousa » 13 May 2014 23:14

All correct Scott
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to General - Archive

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.