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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

119863 Aug 7,2015 09:16 PM Aug 12,2015 02:04 AM JavaScript 3
loading
Tags: ejGrid
Scott Belina
Asked On August 7, 2015 09:16 PM

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:

...
columns
[
{ 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"  />

</script>


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.

Thanks


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

 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.
 

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

 

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.

Regards,

Isuriya R



Scott Belina
Replied On August 11, 2015 09:40 PM

Thanks

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

Hi Scott,

Thanks for your patience.

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

Isuriya R.

CONFIRMATION

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.

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.

;