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

Can't call kendoWIDGET on a div created by React

3 Answers 171 Views
Integration with other JS libraries
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 05 Oct 2015, 09:27 PM

I am trying to integrate the Kendo Grid within a widget owned by ReactJS.  My preference would be initialize this imperatively but it seems that jquery objects from react references don't have the kendo functions attached.  Is it possible to use window.kendo to initialize the grid somehow or do I have to use the jquery plugin functionality?

 

Some code if the above doesn't make sense.  This works: 

window.kendo.bind($(React.findDOMNode(refs.theGrid)), viewModel);

 This doesn't work, returning "Uncaught TypeError: (0 , _jquery2.default)(...).kendoGrid is not a function": 

$(React.findDOMNode(refs.theGrid)).kendoGrid({...});

 Alternatively, any ideas on how to get the jquery plugin functionality back from within React components?

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Oct 2015, 01:43 PM
Hello Timothy,

Getting this error usually means that you have included jQuery after the Kendo UI JS files. Make sure this isn't the case. Other than that you can initialize a kendo ui widget during componentDidMount in a React component. There is an open source library which shows how this could be done: https://github.com/tjwebb/react-kendo/blob/master/lib/KendoWidgetMixin.js

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Timothy
Top achievements
Rank 1
answered on 06 Oct 2015, 03:41 PM
That is not the case.  If that were the case, wouldn't the window.kendo.bind call also not work?
0
Timothy
Top achievements
Rank 1
answered on 06 Oct 2015, 07:01 PM
I think I shall just push ahead with MVVM since it seems to be working.  Thanks for your time.
Tags
Integration with other JS libraries
Asked by
Timothy
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Timothy
Top achievements
Rank 1
Share this question
or