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

Create Kendo widgets using data-role attribute

2 Answers 129 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Taras
Top achievements
Rank 1
Taras asked on 24 Dec 2012, 12:23 PM
Hello,

Kendo UI documentation (http://docs.kendoui.com/howto/add-widgets) says that:

Widgets may configured in the following two (2) ways:

  • in a script block via a jQuery selector and configuration properties;
  • or, with data-* attributes for configuration properties and via a call to kendo.init().
 
However I've tried creating datepicker by using data-role attribute in my web application without calling kendo.init() and it works.
So, there is no longer need calling kendo.init() or there could be some issues with using the control or other controls if not calling kendo.init() ?

Thanks ahead,
Taras

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 25 Dec 2012, 11:35 AM
Hello Taras,

Are you calling kendo.bind instead? Bind method will initialize the widgets using their data-attributes and perform the bindings. If the DatePicker element is bound to a View-Model there is no need to call kendo.init()

If none of the aforementioned methods are executed the widget should not be initialized. Could you please provide your code so I can examine your current implementation?

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Taras
Top achievements
Rank 1
answered on 25 Dec 2012, 05:02 PM
Thank you very much for your quick response!

That's actually the complete answer for my question because I'm using/plan to use MVVM pattern everywhere in the application. 
So in this case kendo.bind will cover widgets initialization.

Regards,
Taras
Tags
General Discussions
Asked by
Taras
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Taras
Top achievements
Rank 1
Share this question
or