TreeGrid v28.2.x - filtering when column type equals "dateTime"

 TreeGrid Filtering when  column type="dateTime"

Question:

1) For the in-column filter (filterSettings.type="filterBar"), what are the filterSettings.column properties needed to make the text entry filter functional for a data field? Currently, all text fails to find a match in this column.

- Note:  Other column filters (string fields) appear to work as "startsWith" and seem to ignore the operator: 'contains'  property in filterSettings.

2) The   filterSettings.column property for this column does not seem to function properly when the value is set to '' (empty) or null.  When value is either of those, a date is pre-populated in the filter.


Config:


this.filterSettings = {
        hierarchyMode: 'Both',
        ignoreAccent: true,
        immediateModeDelay: 50,
        mode: 'Immediate',
        showFilterBarStatus: true,
        type: 'FilterBar',
          columns: [
                    { field: 'data1', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data2', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data3', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data4', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data5', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data6', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data7', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data8', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'data9', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                    { field: 'dateTime', matchCase: false, operator: 'contains', predicate: 'and', value: '' },
                  ]
        };
   }


HTML:

<e-column field='dateTime'  headerText="DateTime" type="dateTime" format="MM/dd/yyyy hh:mm:ss" />


Syncfusion-TreeGrid-filter-problem-2025-04-15 111422.png
Attachment: SyncfusionTreeGridfilterproblem20250415_111422_8bf6ce8a.png


2 Replies

JH JASON HODGES April 16, 2025 02:34 PM UTC

Solved:


Template

<ejs-treegrid

...

(actionBegin)='filterByColumn($event)'

>


TS

  public filterByColumn(args: any): void {
    if (
      args.requestType == 'filtering' &&
      this.filteredCols.some( e=> args.currentFilteringColumn) // Column field is in array of items where this should apply
    ) {
      args.columns.forEach((col) => {
          col.operator = 'contains' // use the 'contains' operator for all columns in the column filter
      });
    }
  }




SS Shereen Shajahan Syncfusion Team April 17, 2025 05:43 AM UTC

Hi Jason

Glad to know the issue has been resolved. Please get back to us for assistance in the future.

Regards,

Shereen


Loader.
Up arrow icon