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

Disable HTML entity encoding & attribute striping

3 Answers 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dominic
Top achievements
Rank 1
Dominic asked on 09 Aug 2011, 10:37 AM
Is there a way to use the Grid widget and leave any HTML elements  as is. I know I can load the grid through a data source and use a template but I would like to leave the existing code as is if I can.

Also whenever I load the grid based on HTML markeup it strips everything out of the table i.e.

<tr><td data-name="somthing">ipso</td></tr>

becomes

<tr><td>ipso</td></tr>
 

Thanks,
Dom

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 10 Aug 2011, 12:44 PM
Hello Dominic,

With current implementation when a html table is used as data for the grid widget, only data from the cells will be extracted and used for creation of a dataSource instance. This dataSource will then be used to create the actual grid markup. Thus, this is the cause for the missing data attributes.  
Having this in mind how would you expect those attributes to be read into the dataSource items. Should they be a "special" properties on the generated record? Would you expect only the data attributes to be extracted?

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dominic
Top achievements
Rank 1
answered on 10 Aug 2011, 12:57 PM
My initial thoughts would be to make it a configurable option.

However I temper this with the following:

1. If its an option, its more code (in Kendo) thus a lean code base starts to become not so lean

2. HTML5 user/developer defined attributes (data-*) need to be clearly separated from anything that Kendo is going to look for i.e. 'data-field'; Kendo attributes that are required should be reserved and documented.

From a beginners experience (with Kendo or Javascript) I would say I spent a large part of yesterday refactoring code so that I could get an <a > and <button> tags working within the table - I eventually moved from building the table from html markup to JSON Data source and Kendo Templates. However it was not obvious or documented that building the grid from markup strips html entities out; or conversely that building the grid through a data source allows HTML entities.

I think a decision shold be made tho whether developers should build 'in widget' HTML through Kendo Templates or direct input. I don't think there's a right or wrong choice here but having a 'standard' or 'preferred' route makes supporting developers easier. Again this could be configurable.

Hope this helps,
Dom
0
Rosen
Telerik team
answered on 11 Aug 2011, 06:50 AM
Hi Dominic,

Thank you for the feedback and suggestions. We will definitely consider them.

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