Combine Excel-like filters and drop-down lists with text search in the same table [message #1851636] |
Mon, 11 April 2022 10:21  |
Eclipse User |
|
|
|
I implemented a tabular view based on NatTable. I use the ComboBoxFilterRowHeaderComposite for filtering the content and it works fine as long as I use the drop-down lists for each column. But for some columns, I prefer to use a text search field instead of the drop-down list. Unfortunately, that seems not to work.
I added a custom configuration that replaces ComboBoxFilterRowHeaderComposite 's default cell editor with a FilterRowTextCellEditor for the desired column index, but I have the following problems: (a) I still see the little triangle that is used for columns with drop-down lists instead of the filter icon. (b) If I try to edit the text field, I see the text entry "SELECT_ALL". (c) If I enter any text contained in the column, all column entries disappear. The filter does not work properly.
My confuguration code snippet:
int descriptionColumnIndex = indexOfColumn( ColumnConstants.COLUMN_DESCRIPTION, columnHeaderDataProvider );
if (descriptionColumnIndex != INDEX_NOT_FOUND ) {
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITOR,
new FilterRowTextCellEditor(),
DisplayMode.NORMAL,
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX
+ descriptionColumnIndex);
}
Am I doing something wrong or can ComboBoxFilterRowHeaderComposite not be used with FilterRowTextCellEditors?
Is there a simple way to debug the configuration, layers' behaviour, etc.?
|
|
|
|
|
Re: Combine Excel-like filters and drop-down lists with text search in the same table [message #1851655 is a reply to message #1851652] |
Tue, 12 April 2022 00:14  |
Eclipse User |
|
|
|
Quote:Do you mean, I would have to replace the ComboBoxFilterRowHeaderComposite and some other related classes with another implementation to make it work?
Yes, the filter strategy, the composite etc. needs to be extended/modified to support a mixture of the two approaches.
Quote:I think, I'm not familiar enough with NatTable's internals to do that. Maybe that could be a feature for some of the next releases? :-)
Well, if you have the resources to sponsor such a feature, that would be possible.
|
|
|
Powered by
FUDForum. Page generated in 0.11321 seconds