jQWidgets Forums
Forum Replies Created
-
Author
-
July 16, 2015 at 11:43 pm in reply to: grid does not work with ui router! grid does not work with ui router! #73837
I was seeing an issue when I upgraded from jqWidgets 3.7.x to 3.8.x.
Some widgets were failing to initialize. (jqxGrid,jqxDropDownList, etc…)
The javascript console was showing the following exception:angular.min.js:102 TypeError: J.controller is not a function
at a (jqxangular.js:7)
at m (jqxangular.js:7)
at n (jqxangular.js:7)
at X (jqxangular.js:7)
at Y (jqxangular.js:7)
at jqxangular.js:7
at angular.min.js:114
at l.$eval (angular.min.js:125)
at l.$digest (angular.min.js:122)
at l.$apply (angular.min.js:126)See the following fiddle to demonstrate: https://jsfiddle.net/3xz1bjqj/8/
What I determined was that the order in which you load the javascript libraries makes a difference when using jqWidgets 3.8.x
The issue occurs when you load jquery after the angular.js libraries like this:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript" src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script> <script type="text/javascript" src="https://www.jqwidgets.com/public/jqwidgets/jqxangular.js"></script>
If you load jquery FIRST like below, the exception disappears:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.15/angular-ui-router.min.js"></script> <script type="text/javascript" src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script> <script type="text/javascript" src="https://www.jqwidgets.com/public/jqwidgets/jqxangular.js"></script>
The order does not seem to matter (ie. loading jquery after angular) when using jqWidgets 3.7.x
-
AuthorPosts