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

Using DOM node in renderer callback

1 Answer 185 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lukas
Top achievements
Rank 1
Lukas asked on 09 Feb 2015, 05:03 PM
Hi!

I'm new to the community and just getting started with the Kendo UI, and while this forum (as well as stackoverflow) is a really great resource, I struggle to find any information about the grid rendering/templating process that would answer my question.

I'm currently in the process of using a Kendo UI Grid instead of a SAP UI5 table (let's assume I know what I'm doing) and would like to stick with UI5's data binding. Thus, I'm in a very special position where the cells in a row would already be defined in a template (similar to the template in the Kendo Grid, but instead of a simple String it is an actual DOM node that would be cloned for every row) (I'll be able to provide a snippet in a bit, just have to work out some issues with that first).

My question is: While I have the 'template' property on a column (which can be a function), it expects the return value to be a String that then later on is used as the html template (using jQuery, I presume). What I want to do though is returning a fresh DOM node (that is created through a factory elsewhere) to be used instead, as in, use the template as a rendering function and putting my own DOM node into the cell. Is that possible?

I have a really hard time stepping through the base code as it is minified and was wondering if anyone knows a trick how to approach this.

I hope I filed this in the right section, thanks in advance!

-- Lukas

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 11 Feb 2015, 01:57 PM
Hello Lukas,

I am afraid there is no practical way to use DOM nodes. Kendo templates (both rowTemplate and column.template) are stings or functions which should return strings. This said you can still use DOM nodes but at the end you will have to return the HTML of those DOM nodes so we can create new DOM nodes. There is no way you can intercept and pass DOM nodes directly which will be rendered by the Grid.

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Lukas
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or