Kendo UI kendo - undefined

I'm just starting to use the Kendo user interface, and I'm having problems getting one of the demos to work. I get Uncaught TypeError: Can't read the observable undefined property on line 43. How can I fix this? Any help is appreciated.

<!DOCTYPE html> <html> <head> <title></title> <link href="./styles/kendo.common.min.css" rel="stylesheet" /> <script src="./js/jquery.min.js"></script> <script src="./js/angular.min.js"></script> <script src="./js/kendo.core.min.js"></script> </head> <body> <div id="example"> <div class="demo-section k-header"> <div class="box-col" style="width: 300px"> <h4>Change the value</h4> <input data-role="slider" data-min="0" data-max="50" data-small-step="5" data-large-step="10" data-bind="visible: isVisible, enabled: isEnabled, value: selectedNumber, events: { change: onChange }" style="width: 180px"> </div> <div class="box-col console-section"> <h4>Console</h4> <div class="console"></div> </div> </div> <div class="box"> <div class="box-col" style="width: 300px"> <h4>Configuration</h4> <div> <label><input type="checkbox" data-bind="checked: isEnabled">Enable</label> </div> <div> <label><input type="checkbox" data-bind="checked: isVisible">Visible</label> </div> </div> </div> <script> var viewModel = kendo.observable({ selectedNumber: 0, isEnabled: true, isVisible: true, onChange: function() { kendoConsole.log("event :: change (" + this.get("selectedNumber") + ")"); } }); kendo.bind($("#example"), viewModel); </script> </div> </body> </html> 
+5
source share
4 answers

You should have a script that does not load. I assume your path is wrong. Keep in mind that when your href and src start with ./ , this means looking for a subdirectory of the current directory. There is a good chance that you do not want the point to be there.

I was able to successfully restore your example here: http://jsfiddle.net/95w1e3s3/

+1
source

You need to include kendo.all.min.js instead of kendo.core.min.js. It seems that .observable is not defined, so you might need another script to include kendo or MVVM binding in this free version in this part.

0
source

kendo.core.min.js has no observable property. You must add kendo.binder.min.js, kendo.data.min.js or kendo.all.min.js.

0
source

You can try: check the version of "jquery.min.js" for version compatibility with the kendo version. this may be a problem in your case.

most of the time you can use jquery version 1.8 with kendo 2015.xx version

0
source

Source: https://habr.com/ru/post/1200629/


All Articles