View Issue Details

IDProjectCategoryView StatusLast Update
0003933JEDI VCL00 JVCL Componentspublic2006-10-17 05:10
ReporterjayAssigned ToInformatix 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.20 
Target VersionFixed in Version 
Summary0003933: JvDBUltimGrid: Add a property "ValidSortColumn" to be able to specify the FieldTypes that may be sorted
DescriptionI am using FIB plus with firebird where I have Lookup columns that I want to sort by using the OnUserSort event. If I click on the header of a Column that is of kind fkLookup, it won't even trigger the event.

I checked the source code line nos 361-362:

if (SortField is TBlobField) or (SortField is TBytesField) or
((SortField.FieldKind <> fkData) and (SortField.FieldKind <> fkInternalCalc)) then

and it does not allow for SortField.FieldKind = fkLookup

I replaced this code with:

if (SortField is TBlobField) or (SortField is TBytesField) or
((SortField.FieldKind <> fkData) and (SortField.FieldKind <> fkInternalCalc) and (SortField.FieldKind <> fkLookUp)) then

and it now works fine and the sort is successfully executed.

This works fine with the FIB components but not with MyDac components and probably won't work with most data access components. However, since there are some (at least FIB) that do, it would be nice to have a property that can be changed to allow it. The default functionality would be equivalent to the the current code (no lookup sort) to not disrupt its current operation.

I hope that I explained myself clearly and that this feature can be added in the near future.

Pleas feel free to contact me if you have any doubts.

Regards,
Jay

TagsNo tags attached.

Activities

jfudickar

2006-10-01 04:04

developer   ~0010265

Wouldn't it be a better solution to add an event for such behaviour?

obones

2006-10-02 01:28

administrator   ~0010270

It might even already be here...

jay

2006-10-02 09:45

reporter   ~0010274

The affected code is inside the Sort() procedure. The first thing that is being done is to validate if the sort can be done or not. The final validation is to check if the the data type of the column is valid for sorting. Within this validation it does not allow fields of class (TBlobField or TBytesField). If it is not one the previous classes it only allows FieldKind (fkData and fkInternalCalc). If it determines that that sort is invalid, it aborts the sort.
Under this condition, other cases may also be viable for sorting (Text Blob fields for example). I understand that for MOST cases, this validation is very logical and is the best default behaviuor.

Although an event may be added (?? OnValidSort) where it may return True or False. I think that a property would be simpler to use and probably easier to implement in the component. However, as long as the developer can control this situation, either solution would be wellcome.

Regards,
Jay

jfudickar

2006-10-13 00:42

developer   ~0010355

A property may be easier to use, but a event is more flexible, so i vote for the event

Informatix

2006-10-17 05:09

developer   ~0010370

Fixed. Soon in SVN.

The new event is called OnCheckIfValidSortField and waits for the result of your own checking routine.

Fred

Issue History

Date Modified Username Field Change
2006-09-29 18:44 jay New Issue
2006-10-01 04:04 jfudickar Note Added: 0010265
2006-10-02 01:28 obones Note Added: 0010270
2006-10-02 09:45 jay Note Added: 0010274
2006-10-12 06:47 Informatix Status new => assigned
2006-10-12 06:47 Informatix Assigned To => Informatix
2006-10-12 06:50 Informatix Status assigned => confirmed
2006-10-13 00:42 jfudickar Note Added: 0010355
2006-10-17 05:09 Informatix Status confirmed => resolved
2006-10-17 05:09 Informatix Resolution open => fixed
2006-10-17 05:09 Informatix Note Added: 0010370