We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Filters doesn't work with \n and \r characters

Hi Team,

One of the column in the grid has data that contains \r and characters and grid rows vanishes if I try to apply filter on this column.

Screenshot of Column Data:



Screenshot of the grid with filter on the Location Column:


Details on the technology used:

Knockout with JS. We are using JS1

Syncfusion Version: 16.4.0.54


JS Code: This is the code i'm using to bind my grids

function bindGrid() { // binds with syncfusion-grid when called

        var fields = getGridFields();

        var tableId = "#" + self.config().tableId;

        if ($(tableId).find('tr').length > 0) {

            $(tableId).ejGrid('destroy');

        }

        $(tableId).ejGrid({

            dataSource: ko.toJS(self.config().data()),

            allowPaging: false,

            allowSorting: true,

            allowFiltering: true,

            allowTextWrap: true,

            allowScrolling: true,

            scrollSettings: { width: self.config().width, height: self.config().height },

            textWrapSettings: { wrapMode: "both" },

            allowResizeToFit: true,

            filterSettings: { filterType: "excel" },

            columns: fields,

            rowSelected: gridSelect,

            rowDeselected: gridSelect,

            rowDataBound: setRowProperties,

            gridLines: ej.Grid.GridLines.Horizontal,

        });

        $(tableId).ejGrid("refreshContent", true);

    }





1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team December 18, 2022 04:33 AM UTC

Hi Kavya,


Greetings from Syncfusion Support.


Futher analyzing, our Grid filter does not support the use of special characters or arithmetic operators such as '>', '<', '=', and '!'. This is because using special characters can impact the jQuery traversing behavior and make it difficult to locate elements.


For more information, please see the following knowledge base article:

https://www.syncfusion.com/kb/4265/why-do-not-use-special-characters-in-grid-id


So we recommend avoiding the use of special characters to avoid issues with traversing. Please get back to us if you need any further assistance.


Regards,

Farveen sulthana T


Loader.
Live Chat Icon For mobile
Up arrow icon