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

Function in ClientTemplate from Server

0 Answers 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
khandokar
Top achievements
Rank 1
khandokar asked on 28 Mar 2018, 02:05 PM

Hi,
In my mvc project grid, subgrid are generated from server side.i want to template one of my column.What i need is to call a java script function from client template.But the java script function call is assigned from server side.

Javascript function : function Test() {return "Hi"; }
Function call in template from server side:  uiGridCoulmn.ClientTemplate= "#=Test() #";

 this showing exactly 'Hi' in my specific column. But the problem is when i set a parameter to Test() and try to add the variable in function call it shows Invalid template

Javascript function : function Test(url) {return "Hi"; }
Function call in template from server side:   var url ="sometext";
                                                                      uiGridCoulmn.ClientTemplate= "#=Test(' "+url+" ') #";

Character ' is actually encoded to \u0027.

How can i stop this?

thanks

sabbir

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
khandokar
Top achievements
Rank 1
Share this question
or