- Регистрация
- 9 Май 2015
- Сообщения
- 1,071
- Баллы
- 155
- Возраст
- 52
We , and now we want to show how you can quickly implement this filter dialog with an Aurelius DataSet.
When working with large datasets in , efficient filtering is essential to enhance performance and user experience. The TTMSFNCDataSetFilterDialog provides a visual and intuitive way to filter records dynamically on client side with just one line. In this blog post, we’ll explore how to integrate TTMSFNCDataSetFilterDialog with an , requiring minimal setup.
Why use TTMSFNCDataSetFilterDialog?
With TTMSFNCDataSetFilterDialog, you can:
The integration process is straightforward: assign the DataSet to the filter dialog and handle the filtering logic in the OnFilterRecord event of the Aurelius DataSet.
Step 1: Assign the DataSet to the Filter Dialog
This can be done in Design Time or programmatically:
DataSetFilterDialog.DataSet := AureliusDataset1;
Step 2: Implement the OnFilterRecord Event
To apply the filter dynamically, use the following code in the OnFilterRecord event of the Aurelius DataSet:
procedure TAureliusDataSetFilterForm.AureliusDataset1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
var
f: TField;
inputArray: TArray<TTMSFNCValue>;
begin
SetLength(inputArray, DataSet.Fields.Count);
for f in DataSet.Fields do
inputArray[f.Index] := TValue.FromVariant(f.AsVariant);
if DataSetFilterDialog.FilterText <> '' then
Accept := DataSetFilterDialog.ValidateFilterRow(inputArray);
end;
Step 3: Open the TTMSFNCDataSetFilterDialog
procedure TAureliusDataSetFilterForm.FilterBtnClick(Sender: TObject);
begin
DataSetFilterDialog.Execute;
end;
How It Works
With just three simple steps, you can enable powerful, dynamic filtering for Aurelius DataSets in your TMS XData applications. The TTMSFNCDataSetFilterDialog enhances user experience by providing an intuitive, no-code filtering mechanism that integrates seamlessly into your applications.
When working with large datasets in , efficient filtering is essential to enhance performance and user experience. The TTMSFNCDataSetFilterDialog provides a visual and intuitive way to filter records dynamically on client side with just one line. In this blog post, we’ll explore how to integrate TTMSFNCDataSetFilterDialog with an , requiring minimal setup.
Why use TTMSFNCDataSetFilterDialog?
With TTMSFNCDataSetFilterDialog, you can:
Easily apply filters to an Aurelius DataSet without manual SQL handling.
Provide users with a visual filtering UI instead of manual condition entry.
Seamlessly integrate advanced filtering logic, including AND/OR operations and type-specific filtering.
Automatically validate filter conditions before applying them.
The integration process is straightforward: assign the DataSet to the filter dialog and handle the filtering logic in the OnFilterRecord event of the Aurelius DataSet.
Step 1: Assign the DataSet to the Filter Dialog
This can be done in Design Time or programmatically:
DataSetFilterDialog.DataSet := AureliusDataset1;
Step 2: Implement the OnFilterRecord Event
To apply the filter dynamically, use the following code in the OnFilterRecord event of the Aurelius DataSet:
procedure TAureliusDataSetFilterForm.AureliusDataset1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
var
f: TField;
inputArray: TArray<TTMSFNCValue>;
begin
SetLength(inputArray, DataSet.Fields.Count);
for f in DataSet.Fields do
inputArray[f.Index] := TValue.FromVariant(f.AsVariant);
if DataSetFilterDialog.FilterText <> '' then
Accept := DataSetFilterDialog.ValidateFilterRow(inputArray);
end;
Step 3: Open the TTMSFNCDataSetFilterDialog
procedure TAureliusDataSetFilterForm.FilterBtnClick(Sender: TObject);
begin
DataSetFilterDialog.Execute;
end;
How It Works
The OnFilterRecord event is triggered automatically for each record.
The code converts field values into an array of TTMSFNCValue.
The ValidateFilterRow function processes the array and determines whether the record should be included.
With just three simple steps, you can enable powerful, dynamic filtering for Aurelius DataSets in your TMS XData applications. The TTMSFNCDataSetFilterDialog enhances user experience by providing an intuitive, no-code filtering mechanism that integrates seamlessly into your applications.