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

[Solved] Turning off default ScriptRegistar

8 Answers 263 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.
Greg Rated
Top achievements
Rank 1
Greg Rated asked on 21 Aug 2009, 05:08 PM
Hi,

I'm already loading up the jquery scripts plus others in my mvc app, how can I turn off the loading of the default scripts in the extension?

Thanks,

Greg

8 Answers, 1 is accepted

Sort by
0
Niels Schneider
Top achievements
Rank 1
answered on 23 Aug 2009, 07:43 PM
Greg,

I assume that you mean the jQuery UI libs. As far I can tell there is no setting for turning it off. Every jQuery UI class registers a link to the jQuery script files with the Registrar through it's base class JQueryViewComponentBase. If changing the MVC.UI.jQuery lib is an option for you, you could simply remove the registration line in the constructor of the JQueryViewComponentBase and recompile the library.

Kind Regards,

Niels Schneider

 

0
Kazi Manzur Rashid
Telerik team
answered on 23 Aug 2009, 08:43 PM
Hi Niels Schneider,

The core jQuery script is loaded in the default group. Each group has a disabled property which you can use to turn off the loading. For the default you can use the following code:

<% Html.Telerik().ScriptRegistrar()
                 .DefaultGroup(group => group.Disabled(true))
                 .Scripts( your scripts)
                 .Render(); %>

The jQueryUI script is loaded in a separate group of Scripts collection which is also named as "jQueryUI", you can also turn it off with the following:

<% Html.Telerik().ScriptRegistrar()
                 .Scripts(script => script.AddGroup("jQueryUI", group => group.Disabled(true)))
                 .Render(); %>

Greetings,
Kazi Manzur Rashid
The Telerik Team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Niels Schneider
Top achievements
Rank 1
answered on 24 Aug 2009, 08:02 AM
Cool. I only browsed to code at stylesheet level for a way to remove the link. Nice to make a disable function at group level.
0
Vincent Girard
Top achievements
Rank 1
answered on 03 Mar 2010, 03:05 AM
What's the difference between :

<% Html.Telerik().ScriptRegistrar() 
                 .DefaultGroup(group => group.Disabled(true)) 
                 .Scripts( your scripts) 
                 .Render(); %> 

And 

<% Html.Telerik().ScriptRegistrar()  
                 .jQuery(false
                 .Scripts( your scripts)  
                 .Render(); %>  

0
Kazi Manzur Rashid
Telerik team
answered on 04 Mar 2010, 08:32 AM
Hi Vincent Girard,

Each group can contain more than one script file and the default group is used to store the jQuery as well as all the Telerik component scripts. So turning it off, your application may not function properly.

On the other hand,  turning off the jQuery(false) means that the default group will not include the jQuery file implicitly. It is actually used when you are applying telerik components in an already developed application or in a situation where adding jQuery script at the bottom of the page is not an option.

Kind regards,
Kazi Manzur Rashid
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
Vincent Girard
Top achievements
Rank 1
answered on 04 Mar 2010, 02:58 PM
So if I want to use ScriptRegistar for the compression and combination utility only for my scripts in all pages I need to disable default group? And what happen if I want to do that in my master but only on one view I need de default group since it has a Grid?
0
Vincent Girard
Top achievements
Rank 1
answered on 04 Mar 2010, 03:00 PM
So if I want to use ScriptRegistar for the compression and combination utility only for my scripts in all pages I need to disable default group? And what happen if I want to do that in my master but only on one view I need de default group since it has a Grid?
0
Kazi Manzur Rashid
Telerik team
answered on 09 Mar 2010, 11:19 AM
Hi Vincent Girard,

No, to Compress and Combine you only have to set the Group Combine to true and add the HttpHandler in the web.config. By default the compression is set to true.

Sincerely yours,
Kazi Manzur Rashid
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.
Tags
General Discussions
Asked by
Greg Rated
Top achievements
Rank 1
Answers by
Niels Schneider
Top achievements
Rank 1
Kazi Manzur Rashid
Telerik team
Vincent Girard
Top achievements
Rank 1
Share this question
or