showFilterBarOperator causes default filter to be overwritten

Hi,

I was struggling with some strange baheavior in filtering which I have now kind of solved but wondered if this is a bug in the grid or in my code.

When setting the default operator on a column to 'contains' the first time conducted a filter the command that was being sent to the datascource using the ODataV4Adaptor was actually 'eq'. If I then dropped down the filter bar operator menu I could see that it was correctly set to 'contains' and from then when I conducted a filter it would correctly send 'contains'.

By trial and error i found that If  i removed the filter bar operator menu from my grid, so changing ..

filterSettings: { showFilterBarOperator: true}

to...

filterSettings: { showFilterBarOperator: false}

the filter then always uses the 'contains' operator.

However, now I have lost the operator selector on the filter bar which I need.

Can you please advise if this is a bug in the grid or in my code? Below is the grid code.

thanks

adam




 <script type="text/javascript">
                            ej.base.setCulture('en');
                            ej.base.setCurrencyCode('GBP');
                            $(document).ready(function () {
                                $(function () {
                                    sfGridManagePersistence('NEWWORKFLOWFORECAST_sfGrid', true); var data = new ej.data.DataManager({
                                        url: '/[DATASOURCE URL REMOVED]',
                                        crossdomain: false,
                                        adaptor: new ej.data.ODataV4Adaptor()
                                    });
                                    ej.grids.Grid.Inject(ej.grids.Filter, ej.grids.ExcelExport, ej.grids.PdfExport, ej.grids.Toolbar);
                                    var NEWWORKFLOWFORECAST_sfGrid = new ej.grids.Grid({
                                        dataSource: data,
                                        autoFitColumns: true,
                                        allowSorting: true,
                                        allowReordering: true,
                                        allowResizing: true,
                                        allowFiltering: true,
                                        filterSettings: { showFilterBarOperator: true},
                                        allowPaging: true,
                                        pageSettings: { pageSize: 10, pageSizes: true, pageCount: 10 },
                                        allowSelection: true,
                                        rowSelected: sfRowSelected,
                                        rowDeselected: sfRowSelected,
                                        showColumnChooser: true,
                                        allowExcelExport: true,
                                        allowPdfExport: true,
                                        toolbar: ['ColumnChooser', 'ExcelExport', 'PdfExport'],
                                        contextMenuItems: [{ text: 'Open Case', target: '.e-content', id: 'open' }, { text: 'Copy with headers', target: '.e-content', id: 'copywithheader' }, 'PdfExport', 'ExcelExport'],
                                        contextMenuClick: function (args) {
                                            if (args.item.id === 'copywithheader') {
                                                NEWWORKFLOWFORECAST_sfGrid.copy(true);
                                            }
                                            if (args.item.id === 'open') {
                                                sfOpenCase(args.rowInfo.rowData["caseid"]);
                                                $("body").css("cursor", "progress");
                                            }
                                        },
                                        columns: [
                                            { type: 'checkbox', width: 50 },
                                            { field: 'caseworkflowid', isPrimaryKey: true, width: '50', visible: true, type: 'number', headerText: 'ID' },
                                            { field: 'caseexternaltitle', width: '500', visible: true, type: 'string', filter: { operator: "contains" },  headerText: 'External Title' },
                                            { field: 'barristername', width: '400', visible: true, type: 'string', filter: { operator: "contains" }, headerText: 'Name' },
                                            { field: 'companyname', width: '200', visible: true, type: 'string', filter: { operator: "contains" }, headerText: 'Company Name' },
                                            { field: 'workflowtemplatename', width: '250', visible: true, type: 'string', filter: { operator: "contains" }, headerText: 'Workflow Template Name' }]
                                    });
                                    NEWWORKFLOWFORECAST_sfGrid.toolbarClick = function (args) {
                                        if (args['item'].id === 'NEWWORKFLOWFORECAST_sfGrid_excelexport') {
                                            NEWWORKFLOWFORECAST_sfGrid.excelExport();
                                        }
                                        if (args['item'].id === 'NEWWORKFLOWFORECAST_sfGrid_pdfexport') {
                                            NEWWORKFLOWFORECAST_sfGrid.pdfExport();
                                        }
                                    }
                                  
                                    NEWWORKFLOWFORECAST_sfGrid.appendTo('#NEWWORKFLOWFORECAST_sfGrid');
                                });
                            })
                           
                        </script>
                      




1 Reply 1 reply marked as answer

AG Ajith Govarthan Syncfusion Team September 23, 2020 01:51 PM UTC

Hi Adam, 

Thanks for contacting Syncfusion support. 

We have validated the provided information and we are able to reproduce the reported problem. We have confirmed it as a bug and logged the defect report “Default filtering operator not applied when enable showFilterBarOperator”. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming  weekly release which is expected to be rolled out on 7th October, 2020. 
    
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.    
    
    
Until then we appreciate your patience.     

Regards, 
Ajith G. 


Marked as answer
Loader.
Up arrow icon