Unplanned
Last Updated: 13 Mar 2020 09:37 by ADMIN
Thirulogachandar Madampuri Kumarasan
Created on: 26 Nov 2014 19:44
Category: Grid
Type: Feature Request
7
Pass data(row data/field data) to the Template for custom command in the grid
We can use template while rendering the custom command but the template doesn't have access to any of the data i.e neither row data(like generic field 'data' in column template) nor field data(individual column). 

There is no easy way to do conditional logic based on the data being rendered for the custom command. e.g. Have different icon for the custom command based  on the status.

We can achieve it during the databound but it is after the fact that the custom control is already rendered and we are tinkering with that. If the computer is too slow or if you have lot of data then user will observe the flickering effect.
4 comments
Levi
Posted on: 27 Sep 2018 21:19
Also custom commands allow you to inline the click handler in the configuration. Regular column templates do not - they require adding that handler in global scope which is not ideal.
ADMIN
Telerik Admin
Posted on: 08 Dec 2014 10:58
This example illustrates how to pass row data to the template displayed when custom command is executed:

http://demos.telerik.com/kendo-ui/grid/custom-command

In case you want to display different content in the column cells depending on your own custom logic, consider using a template column (http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.template).
ADMIN
Telerik Admin
Posted on: 08 Dec 2014 10:58
Thanks for clarifying, Thiru.
Thirulogachandar Madampuri Kumarasan
Posted on: 05 Dec 2014 18:57
I already know that we can do like this. We can also do the same during the data bound. I kindly request to go through my request completely.

I would like to get a feature where we can able to access either the row data or column data during the rendering process itself not after the binding.

As you see in the above post I raised two concerns.

1. If the system is slow or if there are too many records (say 1000 records) I can able to see the flickering effect. (if we do the way you suggested)

2. If we can able to access the data during rendering we can save resources instead of rendering them first and later tinkering with that.