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

Visual Studio JavaScript intellisense with Rad controls

6 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
أشرف
Top achievements
Rank 1
أشرف asked on 12 Dec 2013, 09:29 AM
Greetings,

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

Sort by
0
أشرف
Top achievements
Rank 1
answered on 12 Dec 2013, 10:36 AM
I followed the instructions here and intellisense worked, but not complete and inconsistent.

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"),
When I display the auto complete list for this variable I get only a minimum set of members. When I display the auto complete list for this expression:
$telerik.findGrid("")
I get far more members, although get_batchEditingManager is still not among them.
0
Accepted
Angel Petrov
Telerik team
answered on 17 Dec 2013, 12:02 PM
Hi Ashraf,

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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
أشرف
Top achievements
Rank 1
answered on 19 Dec 2013, 10:45 AM
I don't know what happened. When I moved my scripts to a class library project, I found that Telerik intellisense stopped working.
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.
0
Jacques
Top achievements
Rank 2
answered on 25 Feb 2016, 01:35 PM

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? 

0
Jacques
Top achievements
Rank 2
answered on 25 Feb 2016, 01:46 PM

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. 

0
أشرف
Top achievements
Rank 1
answered on 25 Feb 2016, 02:39 PM

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.

Tags
General Discussions
Asked by
أشرف
Top achievements
Rank 1
Answers by
أشرف
Top achievements
Rank 1
Angel Petrov
Telerik team
Jacques
Top achievements
Rank 2
Share this question
or