This is a migrated thread and some comments may be shown as answers.

Apostrophe in RadGrid filtering causing JavaScript error

5 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 06 Feb 2015, 06:07 PM
Using 2014.3.1209.40 DLL getting JavaScript error if user tries to filter a column with a string containing an apostrophe (single quote, chr(39))

Same behavior can be seen in Telerik's own online demo: http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx
In Model column enter something like Joe's click the filter button, select Contains and you get:

Line: 5022
Error: Expected ')'

Tried escaping the apostrophe as \' or /' or ['] - same result

As an unrelated issue - tried entering HTML encoded string version Joe's and clicked filter/Contains - page redirected to "Oh, no!  It seems we've lost this page!"

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 10 Feb 2015, 10:27 AM
Hi Richard,

This problem is already fixed in our Q1 2015 Beta release which is already available for download. You can test how the grid filtering is working with this version here:
http://demos.telerik.com/aspnet-ajax-beta/grid/examples/overview/defaultcs.aspx#

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Curtis
Top achievements
Rank 1
answered on 01 Feb 2016, 04:31 AM

I am using the latest 2016.1.113.45 and am getting a Javascript error when filtering with an apostrophe/single quote when the grid is in RenderMode="Mobile". When the grid is in RenderMode="Auto", the filtering with an apostrophe works.

I will report the bug as well.

Timestamp: 1/31/2016 10:29:12 PM
Error: SyntaxError: missing ) after argument list
Source File: http://localhost:86/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ctl00_ctl00_rsm_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2016.1.113.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen%3acb3d1a3e-7303-48dc-a612-61700f912203%3aed16cbdc%3a56e9f55f%3af46195d3%3a2a733ecd%3ab7778d6c%3ae085fe68%3a531d45cc%3aa00338a7%3a8bd58b44%3a2d1fc316%3a72040467
Line: 1, Column: 143
Source Code:
$c1$grid$ctl00;HeaderContextMenuFilter;Name|?Contains|crowe's|?NoFilter||?')

0
Pavlina
Telerik team
answered on 02 Feb 2016, 01:43 PM
Hello Curtis, 

Indeed the issue you are facing exists in the latest version and it is already logged in our bug tracking system. There is also a feedback item on the matter from where you can follow its progress :
http://feedback.telerik.com/Project/108/Feedback/Details/181661-filtering-grid-item-with-single-quote-causes-javascript-error

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Raymond
Top achievements
Rank 1
answered on 07 Apr 2017, 05:00 PM
This also appears to impact scenarios where the field containing the apostrophe is the detail key field in a master/detail relationship.
0
Pavlina
Telerik team
answered on 12 Apr 2017, 03:57 PM
Hello Raymond,

You can add the mentioned scenario in the feedback item, so we can have it in mind while fixing the issue.

Regards,
Pavlina
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Curtis
Top achievements
Rank 1
Raymond
Top achievements
Rank 1
Share this question
or