Declined
Last Updated: 02 Aug 2019 09:53 by ADMIN
Sreenath
Created on: 12 Jul 2019 06:17
Category: Grid
Type: Bug Report
0
Kendo Grid columns binding dynamically with anchar tag template when column have space then i am getting java script error

Hi

I am binding columns dynamcially in jquery without template column header spacing working file becuase i have added "[ ]" this symbol.

but when try to add anchor tag link with onclick method then i am getting issue.

i have attached file java script error please provide some solutions.

 

Attached Files:
5 comments
ADMIN
Viktor Tachev
Posted on: 02 Aug 2019 09:53

Hello Sreenath,

 

The field names that the Grid columns are bound to should not contain any spaces in order for the components to work as expected. I would recommend updating the Model on the server-side and removing the spaces or replacing them with underscore.

 

Regards, Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Sreenath
Posted on: 26 Jul 2019 18:01

Hi Viktor

so if we have spaces in column name fileds then we can't create template for that filed in kendo grid.

 

Note : Provide me some  solution how to come out this problem.please give me answer it possbile or not.becuase click on that hyper link i need to read particluar clicked  row data and i need to pass this infromation to another page or etc..

 

 

 

 

 

ADMIN
Viktor Tachev
Posted on: 25 Jul 2019 12:40
Hello Sreenath,

The columns.field option should be set to a valid JavaScript identifier. Have in mind that JavaScript identifiers should not contain spaces. For more information on identifiers please refer to the article below:



Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Sreenath
Posted on: 19 Jul 2019 06:20
 

Hi viktor Tachev,

my Question is in template render filed Name will contains spaces getting above issue.for exmple please find below Code

Note: File Name="Student Id";

var GridTitleArray[i]="Student Id";

GridColumnGeneration.push({
                                title: "Student",
                                field: "[\"" + GridTitleArray[i] + "\"]",
                                template: "<a href='\\\\#' style='text-decoration:underline' class='link' onclick='studentProfile(\"#=[StudentId]\#\")' \"> #=[Student Id]#</a>",
                                headerAttributes: { class: "header_text" }, attributes: { class: className }
                            });

 

 

 

ADMIN
Viktor Tachev
Posted on: 19 Jul 2019 05:50
Hi Sreenath,

The error you are seeing is usually observed when there are unescaped hash characters in the column template. Make sure that all literal # characters are escapes with tow backslashes and see how the behavior changes. If you would like more information on using Kendo Templates you would find the article below interesting.


With that said, if the error persists would you send us a runnable sample where it is replicated? This will enable us to examine the issue locally and look for its cause.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.