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

[Solved] createWidget call fails with element.is is not a function

1 Answer 179 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 04 Nov 2014, 12:33 AM
I am using kendo UI with AngularJS, and have ran into this issue in Firefox.

Version Information
===============
Kendo UI Version : v2014.2.1008

Issue reproducible ONLY in Firefox (v33.0.2), works fine in Chrome.

Exception stack trace :
=======================
createWidget@http://localhost/Scripts/lib/kendo.all.js:83279:13\n\n
createIt@http://localhost/Scripts/lib/kendo.all.js:83407:38\n\n
timeout/timeoutId<@http://localhost/Scripts/lib/angular/angular.js:14304:28\n\n
completeOutstandingRequest@http://localhost/Scripts/lib/angular/angular.js:4397:7\n\n
Browser/self.defer/timeoutId<@http://localhost/Scripts/lib/angular/angular.js:4705:7"

On debugging further, I figured that the issue is with 'element' argument passed to link function of 'directiveFactory' angular directive. 

module.factory('directiveFactory', ['$timeout', '$parse', '$compile', '$log', function(timeout, parse, compile, log) {
...
...
...
link: function(scope, element, attrs, controllers) {

While 'element' is interpreted as a jQuery wrapped obj in Chrome, it's just an Object inside Firefox. Hence, inside createWidget(), the following check fails inside Firefox :

            if (element.is("select")) {

As an immediate fix, I have modified createWidget() call inside createIt() 
from
           var widget = createWidget(scope, element, attrs, role, origAttr);
to
           var widget = createWidget(scope, ((element instanceof jQuery) ? element : $(element)), attrs, role, origAttr);

This resolves the issue.

Question
=========

Can you investigate this issue and suggest a permanent fix / workaround for this issue ?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 05 Nov 2014, 03:53 PM
Hi Robert,

Do you reproduce the described problem on our online demos? If not, then please send a runnable example. If yes, then specify which demo you are testing with.

http://demos.telerik.com/kendo-ui/combobox/angular

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or