Declined
Last Updated: 10 Jun 2021 10:57 by ADMIN
Lorenzo
Created on: 28 Jan 2013 14:11
Category: UI for ASP.NET MVC
Type: Feature Request
2
When using DeferredScripts() possibly bundle all the controls initialization in one single jQuery initialization function.
When using Html.Kendo().DeferredScripts() possibly bundle all the controls initialization in one single jQuery initialization function, instead of a call for each of the deferred controls.
2 comments
Imported User
Posted on: 24 May 2013 15:37
Did anyone realize that Deferred() is actually almost useless?  It deferrs all script output even in a partial view scenario - which will not be output!

Obviously, you made deferred() so we could get the scripts at the bottom and that is great.  So, when we use Model.EditorFor(blah), we define an EditorTemplate for that.   We use Kendo for the editor template of course and in there we need to put Deferred() so the script will output at the bottom......BUT WAIT....sometimes EditorFor() would be used in a partial view!!!  This means you cannot use Deferred() on any editor templates - which means that almost NO SCRIPTS would be deferred!

Solution:   Modify Deferred() to detect if it is an ajax request and if it is, do not defer the script output.  You could even offer an option to disable that feature in case it messes up a scenario.   So, when you have done this - I WOULD be able to have Deferred() in my example I sent you as well as in my EditorFor() templates.

Imported User
Posted on: 13 May 2013 17:01
Additionally, what about a web.config setting to turn Deferred() on by default.
Then we could use Deferred(false) if we wanted it to turn it off.
As it is, we have to put this Deferred() call on every kendo control - when really this is a 'project' type decision..