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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do you make a column template generic for use with more than one column in an ejGrid?

Thread ID:





119863 Aug 8,2015 01:16 AM UTC Aug 12,2015 06:04 AM UTC JavaScript 3
Tags: ejGrid
Scott Belina
Asked On August 8, 2015 01:16 AM UTC

I have a grid bound to a data source that could have 20 columns with the same data type. I would like them all to be formatted the same way. Can you use a generic column template that could be apply separately to each field?

I would like to be able to do something like:

{ field: 'Field1', columnTemplate: true, templateId: "#fieldTemplate" }
{ field: 'Field2', columnTemplate: true, templateId: "#fieldTemplate" }
{ field: 'Field3', columnTemplate: true, templateId: "#fieldTemplate" }

and then in the template, reference the field, something like:

<script type="text/x-jsrender" id="fieldTemplate">

       <img src="images/{{:WHAT DO I PUT HERE?}}.png"  />


I do not have to repeat this script block for each different field, do I?

I found this post (http://www.syncfusion.com/forums/116069/example-documentation-on-how-to-use-a-column-template) but the suggested solution will not work for me because I need the fields to be in individual columns.


Isuriya Rajan [Syncfusion]
Replied On August 10, 2015 10:22 AM UTC

 Hi Scott,

 We considered this “Column details at column template” as an improvement 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.



As of now, this issue can be handled by using the following workaround solution. We should give separate column template script for each template.

Please let us know if you require further assistance on this.


Isuriya R

Scott Belina
Replied On August 12, 2015 01:40 AM UTC


Isuriya Rajan [Syncfusion]
Replied On August 12, 2015 06:04 AM UTC

Hi Scott,

Thanks for your patience.

Please let us know if you require further assistance on this.We are happy to assist you.

Isuriya R.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon