Js error while filtering using Outlook

Hello support,

This error occurs only while browsing through outlook and cannot be reproduced on IE, chrome or firefox.

aspx:

    <ej:DataManager ID="MetadocsData" runat="server" Adaptor="JsonAdaptor" Offline="true" EnableCaching="true" />

    <ej:Grid ID="MetadocsGrid" runat="server" DataManagerID="MetadocsData" AllowPaging="True" AllowSorting="true" AllowMultiSorting="true" AllowSearching="true" AllowScrolling="false"


        AllowFiltering="True" AllowResizeToFit="False" MinWidth="600" Locale="el-GR" GridLines="Horizontal" AllowResizing="true" AllowReordering="true" EnableResponsiveRow="true" IsResponsive="true" AllowCellMerging="true">

        <ClientSideEvents TemplateRefresh="templateRefresh" RecordClick="recordClickEvt" ContextOpen="contextOpenEvt" ActionComplete="onComplete" RecordDoubleClick="onDoubleClickLibraryEvt" Load="onLoadLibraryGrid" />

        <FilterSettings FilterType="Menu" EnableCaseSensitivity="false" />

        <ToolbarSettings ShowToolbar="true" ToolbarItems="search"></ToolbarSettings>

        <SearchSettings Operator="Contains" IgnoreCase="true" />

        <ContextMenuSettings EnableContextMenu="true"></ContextMenuSettings>

        <ScrollSettings Width="100%" Height="100%" />

        <PageSettings PageSize="20" />

        <ResizeSettings ResizeMode="Normal"></ResizeSettings>

    </ej:Grid>


The grid columns and data are populated in the backend. Has 3 static columns, 2 hidden and the rest are coming from a service.


this.MetadocsGrid.Columns.Clear();

            this.MetadocsGrid.Columns.Add(new Column() { Field = "Type", HeaderText = "Type", HeaderTooltip = "Type", DataType = "string", Width = "80px", CssClass = "gridHeaderTh", Template = "<div class='{{:Type}}' style='margin-left:10px;'></div>" });

 this.MetadocsGrid.Columns.Add(new Column() { Field = "Title", HeaderText = "Title", HeaderTooltip = "The Title", DataType = "string", CssClass = "gridTitleColumn" });

foreach (DynamicColumns columnObj in libObj._libraryObj.DynColumns)

            {

                    this.MetadocsGrid.Columns.Add(new Column() { Field = columnObj.Title, HeaderText = columnObj.Title, HeaderTooltip = columnObj.Title, DataType = GetSyncfusionColumnType(columnObj.Type, columnObj.Title), DisableHtmlEncode = true, CssClass = "gridHeaderTh" });

            }

this.MetadocsGrid.Columns.Add(new Column() { Field = "Size", HeaderText = "Size", HeaderTooltip = "Size", DataType = "string", AllowTextWrap = false, CssClass = "gridHeaderTh", Width = "100px" });

this.MetadocsGrid.Columns.Add(new Column() { Field = "Att", HeaderText = "Att", DataType = "boolean", Visible = false });

this.MetadocsGrid.Columns.Add(new Column() { Field = "Id", HeaderText = "Id", DataType = "number", Visible = false });


Then i am creating a DataTable obj, creating columns with the same name, adding rows with the data and lastly binding to the ej:DataManager.


 this.MetadocsData.Json = datatable;

            this.MetadocsGrid.DataBind();


I noticed that i can filter the static columns without error. Can also filter the dynamic column named 'To' but no other(maybe cannot handle the spaces?).

I also tried a few polyfils to no avail.

errorOnfilteringDynCol.jpg


3 Replies 1 reply marked as answer

JR Jagadesh Ram Raajkumar Syncfusion Team October 25, 2021 12:59 PM UTC

Hi Stavros, 

Greetings from Syncfusion Support. 

Based on your screenshot and code, The column header text and field name is set as the same for the dynamic column. Based on the screenshot it is advised to assign a single name with no special characters to the field name. If possible please revert us after changing the field name of the dynamic column to a single name without spaces or special characters.  

If still facing the issue, kindly share with us the sample data used for grid and entire grid code including events. 
Regards,
Jagadesh Ram 


Marked as answer

SN Stavros Nissopoulos replied to Jagadesh Ram Raajkumar October 25, 2021 03:34 PM UTC

The solution provided worked.

In my solution i replace all whitespaces and illegal chars with an empty string using the below:

string pattern = "[\\~#%&*{}/:<>?|\"-()']";

Regex regEx = new Regex(pattern);

Regex.Replace(regEx.Replace(columnName, ""), @"\s+", "");


Thank you!



JR Jagadesh Ram Raajkumar Syncfusion Team October 26, 2021 04:37 AM UTC

Hi Stavros, 

Thanks for the update. 

We are glad that your query has been resolved.

Kindly get back to us for further assistance. 
Regards,
Jagadesh Ram 


Loader.
Up arrow icon