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

Error on Foreign Key column


 I jsut created inside a grid a Foreign Key Column.
The DataSource is a simple List of Objects of type {Id, Name}

I received the following error:

Unhandled exception at line 862, column 4 in http://localhost:10355/Scripts/jsrender.js
0x800a139e - Errore di run-time di JavaScript: JsRender Error: Syntax error
Compiled template code:

I investigated further and discovered that the problem happens on one element that has a single quote characted in the Name field value (there was 2 of that characters not near)
This makes the jsrender to throw an exception with the generated template.

    Andrea Perazzolo

5 Replies

AR Ajith R Syncfusion Team January 20, 2015 01:39 PM UTC

Hi Andrea,

Thanks for using Syncfusion products.

Query: JsRender Error in foreign key column

We are sorry to let you know that we are unable to reproduce your reported issue. We need further clarification about your query, Please refer the below queries for further details.

1.     Could you please let us know whether you have set the single quote in your data source value or columns Field value?

2.       Please share us the code snippet or get back to us with reproducing the issue in the below sample, It will be helpful for us to analyze about the issue and provide you the response as early as possible.

For your convenience we have created a simple sample and the same can be downloaded from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/117987/ListOfObjectGrid871880270.zip

Please let us know if you have any concerns.


Ajith R

AP Andrea Perazzolo January 20, 2015 02:02 PM UTC

Just a way to reproduce the problem even with your sample:

1) Open with Visual Studio the file NORTHWND.MDF.
2) Show Data on the Table "Employee"
3) Modify a record "LastName" field inserting ' (quote) characters inside the value
4) Start the application on the Grid Page

The error appears.
The error,, as i noted, seems that the single quote character make the string with data passed to jsrender be in invalid format, so the jsrender throws an exception.
Whith the double quote character the error does not appear..

    Andrea Perazzolo

AR Ajith R Syncfusion Team January 21, 2015 07:28 AM UTC

Hi Andrea,

Thanks for your update.

We are able to reproduce your reported issue.

We considered this “Script error throws when single quote in the foreign key column value” as an issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.


Please let us know if you have any concerns.


Ajith R

MI Mike April 28, 2016 07:30 AM UTC

I use your js libraray and have the same issue. And wherte i can check status of this support incident? 

RU Ragavee U S Syncfusion Team April 29, 2016 03:46 PM UTC

Hi Mike, 

From our records, we found that you are using our Volume 4, 2015 v13.4.0.53. We have created a foreign key sample with single quotes field values, which can be referred in the below link. 

The issue “Script error throws when single quote in the foreign key column value” has been fixed and included from our v13.4.0.53. We are unable to reproduce the reported issue in the above sample. So could you please share the below details 

1.       Product version you are currently working on. 
2.       Issue reproducible sample or please reproduce the issue in the above provided sample and share. 
3.       Screenshot of the issue with call stack of the script error obtained. 
4.       Clear replication procedure to reproduce the issue. 

Ragavee U S. 

Live Chat Icon For mobile
Up arrow icon