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

Telerik doesn't let me work with JQuery UI

3 Answers 280 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
rodri
Top achievements
Rank 1
rodri asked on 06 Jan 2011, 11:07 PM
[ASP.NET MVC 3 RC 2, Telerik 2010.3.1110, JQuery 1.4.4 , JQuery UI 1.8.7]
Hi,

I'm trying to implement some JQuery UI features along with Telerik's components. But the library seems to be overtaken by the Telerik's JQuery version. because I cannot call any JQuery UI method (Their extension methods are not being attached to the document).

Is there any chance to know why telerik's components block any other open source features?

Note: If I don't use a layout with telerik's ScriptRegistrar method call, everything works fine.

regards
Rodrigo

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 07 Jan 2011, 08:15 AM
Hi rodri,

First of all Telerik extensions for ASP.NET MVC are *NOT* blocking other open source libraries (e.g. jQuery UI).

The ScriptRegistrar is including the jQuery JavaScript file by default. I think you are including the jQuery UI script before that hence it does not work. I suggest you disable the automatic including of jQuery like this:

<%= Html.Telerik().ScriptRegistrar().jQuery(false) %>

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
rodri
Top achievements
Rank 1
answered on 07 Jan 2011, 03:50 PM
@Atanas,

I tried your suggestion, but after that any Telerik library doesn't work with the normal javascript behavior. I had to do a trick in order to make everything work.

[HOW I SOLVED IT]

1. I left my call to JQuery library at the begging of my layout:
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
If I don't do this, my calls to JQuery functionality won't work.

2. Then at the end, I modified the default ScriptRegistrar method to:

@Html.Telerik().ScriptRegistrar().Scripts(scripts =>
            scripts.AddGroup("CommonScript", group =>
                group.Add("~/Scripts/jquery-1.4.4.min.js")
                     .Add("~/Scripts/jquery.validate.js")
                     .Add("~/Scripts/jquery.validate.unobtrusive.js")
                     .Add("~/Scripts/JQueryUI/jquery.ui.core.js")
                     .Add("~/Scripts/JQueryUI/jquery.ui.widget.js")
                     .Add("~/Scripts/JQueryUI/jquery.ui.position.js")
                     .Add("~/Scripts/JQueryUI/jquery.ui.dialog.js")
            )
         )
3. Finally, I had to copy my jquery.validate.unobtrusive.js file to the telerik's "2010.3.1110" folder

Now it works fine. although I can't call some JQuery functions like the "JQuery" selector i.e. JQuery("#myDiv") -> replace it for $("#myDiv"). I don't know if I'll have any throuble in the future with any other library.
0
Naveen
Top achievements
Rank 1
answered on 09 Nov 2011, 01:21 PM
Hi ,

 Unfortuanately i could not get how you achieved this.
I need something similar, like to register my jquery-mobile.js file ., can u please explain me how u achieved.Thanks

Thanks
Naveen
Tags
General Discussions
Asked by
rodri
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
rodri
Top achievements
Rank 1
Naveen
Top achievements
Rank 1
Share this question
or