I'm doing heavy client side work with Rad controls, specially the grid. I became tired from copying and pasting functions names from the console and hoped that Visual Studio intellisense would help me.
I tried adding the Telerik.Web.UI.Common.Core.js file downloaded from the CDN to my Visual Studio references but intellisense broke.
Does Telerik have a vsdoc (or any other format) definitions file for the library that can be referenced from VS to ease client side development?
6 Answers, 1 is accepted
For example, the auto complete list doesn't provide the get_batchEditingManager member of the grid. Intellisense doesn't recognize Telerik.Web.UI.GridBatchEditing altogether.
I have a variable annotated like this:
/// <var type="Telerik.Web.UI.RadGrid"></var>
var
grid = $find(
"ctl00_ctl00_ContentPlaceHolder1_master_FormView1_Items_RadGrid1"
),
$telerik.findGrid(
""
)
Indeed your observations are correct. Currently there are some methods and properties which are not available in the intellisense. I have logged this as an improvement in our feedback portal and it will be reviewed by our developers. You can check the progress of this item from here.
Regards,
Angel Petrov
Telerik
I registered the Telerik.Web.UI assembly in the GAC but this didn't solve the problem.
I had to extract the script files from the assembly and store them on my disk for intellisense to work. Here's the contents of my _refernces.js file now:
/// <reference path="jquery-2.0.3-vsdoc.js" />
/// <reference path="globalize.js" />
/// <reference path="knockout-3.0.0.debug.js" />
/// <reference path="MicrosoftAjax.debug.js" />
//#region Telerik
/// <reference path="Telerik.Web.UI.Ajax.Ajax.js" />
/// <reference path="Telerik.Web.UI.Common.Animation.AnimationScripts.js" />
/// <reference path="Telerik.Web.UI.Common.Extensions.js" />
/// <reference path="Telerik.Web.UI.Grid.RadGridScripts.js" />
/// <reference path="Telerik.Web.UI.Grid.GridBatchEditingScripts.js" />
/// <reference path="Telerik.Web.UI.Grid.GridCellSelection.js" />
/// <reference path="Telerik.Web.UI.Grid.GridVirtualizationScripts.js" />
/// <reference path="Telerik.Web.UI.SearchBox.RadSearchBoxScripts.js" />
/// <reference path="Telerik.Web.UI.ToolTip.RadToolTipScripts.js" />
/// <reference path="Telerik.Web.UI.Window.RadWindowManager.js" />
/// <reference path="Telerik.Web.UI.Window.RadWindowScripts.js" />
/// <reference path="Telerik.Web.UI.Common.Core-vsdoc.js" />
//#endregion
I hope this doesn't violate the terms of use.
I'm working in Sitefinity 8.x and trying to get intellisense working for external JS files. I've tried all the above examples as well as a number of other examples of other posts and none of it seems to work.
Does this still work if you use the "/// <reference approach" referencing the Telerik.Web.UI assembly in the bin folder of a Sitefinity project?
PS. I've added:
/// <autosync enabled="false" />
/// <reference name="MicrosoftAjax.js"/>
/// <reference path="modernizr-2.6.2.js" />
/// <reference path="jquery-1.10.2.js" />
/// <reference path="../js/kendo.all.min.js" />
/// <reference path="bootstrap.js" />
/// <reference path="custom-code.js" />
To the _references.js file and the intellisense for each of those files works.
I added the following:
///<reference name="Telerik.Web.UI.Common.Core.js" assembly="Telerik.Web.UI"/>
To both the individual JS files and tried it in the _reference.js file, but no $telerik.
I tried this one too:
/// <reference path="Telerik.Web.UI.Common.Core-vsdoc.js" />
Nothing!
Any help would be great.
Jacques, you have to extract the js files from the assembly using a reflector like JustDecompile. Place them in a folder beside the _references.js. Make all paths in _references.js absolute. For example, if you placed your files in d:\intellisense a reference will be like this:
/// <reference name="d:\intellisense\MicrosoftAjax.js"/>
I don't know why VS get choked when the paths are relative to _references.js. This could be a bug.
When diagnosing such issues, keep the VS output panel open and select the "JavaScript Language Service" output. If there're problems, error messages will be displayed there.