Initialize widgets with data attribute

1 Answer 85 Views
General Discussions
Morten
Top achievements
Rank 2
Iron
Iron
Iron
Morten asked on 25 May 2024, 09:27 AM

Sometimes, I find it easier to initialize widgets using data attributes.

However, I often find it difficult to find precise documentation on initialising specific widget properties, and I find myself trying out various attributes combinations.

1) Can all properties/settings for every Kendo UI jQuery widget be initialized using data attributes?

2) Where can I find documentation (API documentation) on initialising every property/setting for each widget using data attributes?

 

1 Answer, 1 is accepted

Sort by
0
Yordan
Telerik team
answered on 30 May 2024, 05:58 AM

Hello Morten,

Thank you for reaching us!

All properties/settings for every Kendo UI jQuery widget can be set through data attributes. 

Unfortunately, there is no such place in the documentation where you can find all data attributes listed.

Data attribute binding can be done using the kendo.init() or kendo.bind() methods.

Data attribute's names are the same as the configurations/properties in the API, but the uppercase letters in the property name are replaced by "-" and a lowercase version of the letter.

Examples: 

  • columnTemplate -> data-column-template
  • allowCopy -> data-allow-copy

You can use the API for each component as a reference to pick what properties suit your case and use them with the "data-" prefix as attributes.

Here are some helpful articles with explanation and details about this approach:

Regards,
Yordan
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Tags
General Discussions
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Yordan
Telerik team
Share this question
or