This question is locked. New answers and comments are not allowed.
Hi!
We have had some problems with grids loaded inside tabstrips using ajax, and have finally tracked down a cause of it.
Scenario: We load all scripts directly in the main layout page, the issue occurs when using Combined(true), not otherwise. It occurs both for the minified version of grid.js and the non-minified one. Init code for us looks like this:
When clicking the tab loading the grid via ajax we get this error:
The code giving the error can be found ~row 200 in grid.js (2011.2.914):
When changing those rows to this:
Edit: Also in grid.js: Row 19 is missing a comma in the end of the row, making FOCUSED a global variable when minified and dependant on browser when not.
Related to this: Is it possible to disable the autoloading of scripts via ajax globally? We seem to get those at times despite having included everything. (Same is sometimes true for non-ajax pages as well where we because of this get telerik script files included twice in one page)
Not really related: The Telerik CDN is a really great idea we think, really neat! However we would really like an option to include telerik.mvc.all.min.js, since loading all scripts separately does not seem like a temping option for us. For styles not at all as important since usually only one theme is used at the time.
I really hope the main issue can be solved quickly!
Thanks!
/Victor Ström
We have had some problems with grids loaded inside tabstrips using ajax, and have finally tracked down a cause of it.
Scenario: We load all scripts directly in the main layout page, the issue occurs when using Combined(true), not otherwise. It occurs both for the minified version of grid.js and the non-minified one. Init code for us looks like this:
@(Html.Telerik().ScriptRegistrar().jQuery(false).jQueryValidation(false).Globalization(true).DefaultGroup(group => group .Add("jquery.validate.min.js") .Add("jquery.validate.unobtrusive.min.js") .Add("telerik.common.min.js") .Add("telerik.slider.min.js") .Add("telerik.list.min.js") .Add("telerik.upload.min.js") .Add("telerik.autocomplete.min.js") .Add("telerik.combobox.min.js") .Add("telerik.calendar.min.js") .Add("telerik.datepicker.min.js") .Add("telerik.datetimepicker.min.js") .Add("telerik.timepicker.min.js") .Add("telerik.textbox.min.js") .Add("telerik.draganddrop.min.js") .Add("telerik.grid.min.js") .Add("telerik.grid.grouping.min.js") .Add("telerik.grid.filtering.min.js") .Add("telerik.grid.resizing.min.js") .Add("telerik.grid.reordering.min.js") .Add("telerik.grid.editing.min.js") .Add("telerik.window.min.js") .Add("telerik.tabstrip.min.js") .Add("telerik.editor.min.js") .Add("telerik.menu.min.js") .Add("telerik.panelbar.min.js") .Add("telerik.treeview.min.js") .Add("telerik.chart.min.js") .Combined(true) //.Compress(true) --does not matter, but impossible to debug turned on of course...
))When clicking the tab loading the grid via ajax we get this error:
- $t[this.plugins[i]] is undefined
The code giving the error can be found ~row 200 in grid.js (2011.2.914):
for (var i = 0; i < this.plugins.length; i++) $t[this.plugins[i]].initialize(this);When changing those rows to this:
console.log(this.plugins);console.log($t);for (var i = 0; i < this.plugins.length; i++) { console.log(this.plugins[i]); console.log($t[this.plugins[i]] != null); if($t[this.plugins[i]] != null) $t[this.plugins[i]].initialize(this);}some interesting things can be noted:
- The error is gone and the tabstrip and grid works
- The plugins to be loaded are: ["grouping", "filtering", "resizing", "reordering"]
- $t.scripts holds these:["telerik.tabstrip.js", "telerik.grid.js", "telerik.draganddrop.js", "telerik.grid.resizing.js", "telerik.menu.js"]
- For grouping, filtering and reordering, the if clause evaluates to "false" and initialize is skipped
Edit: Also in grid.js: Row 19 is missing a comma in the end of the row, making FOCUSED a global variable when minified and dependant on browser when not.
Related to this: Is it possible to disable the autoloading of scripts via ajax globally? We seem to get those at times despite having included everything. (Same is sometimes true for non-ajax pages as well where we because of this get telerik script files included twice in one page)
Not really related: The Telerik CDN is a really great idea we think, really neat! However we would really like an option to include telerik.mvc.all.min.js, since loading all scripts separately does not seem like a temping option for us. For styles not at all as important since usually only one theme is used at the time.
I really hope the main issue can be solved quickly!
Thanks!
/Victor Ström