- This topic has 9 replies, 2 voices, and was last updated 12 years ago by support-tony.
-
AuthorPosts
-
joborMemberHello,
jQuery is nice in MyEclipse 10.6 but I do want to use Kendo UI JS lib in my project and to have the same kind of code completion.
see http://www.kendoui.com/web.aspx
If I make a JS user library with the name KendoUI and add the kendo.all.js file nothing happens with CTRL+space. I did add the user librarary to the build path.
I am not writing JS in an HTML page but in a JS file like [projectPath]/web/js/myCode.js
T.I.A.
Johan Borchers
support-tonyKeymasterJohan,
It seems that you created a Java user library, rather than a JavaScript user library.
To create a javascript user library, right click on the project then select Properties. Now go to MyEclipse->JavaScript->Include Path and click the Add JavaScript Library button. Select User Library and click Next. Then click Configure User Libraries. On the next screen, click New and then enter a name for your library. Now your library will appear in the list of user libraries. Select your library and then click Add .js File and browse to the kendo.all.js file to add it to your library. Click OK. Now you can select the library and add it to the include path. You should now get content assist for the kendo objects.
Let us know if this helps. If not, could you please describe, in detail, how you added and used the user library?
joborMemberHello,
Thanks for the anwer. But as far I know I already did what you say. Adding a Javascript library to the project, select user library, and after seeing am ampty list create a new javascript library with a name and ading the JS source to it and save. Then I was abble to add the javascript user library to the project.
Oke if I type the word kendo. and press CTRL+space something appears of kendo but I can’t do anything with it.The only things that are very good working are the core Javascript and the jQuery library with code completion.
I was thinking how the code completeion works. Is it dependent of JSDoc tags in the JS file or does the code completion work on some kind of introspection?
For KendoUi they provide only so called VSDoc (Visual Studio) comments.T.I.A. Johan
support-tonyKeymasterJohan,
I’m afraid I’m not clear on the problem. You first said that nothing happened when you pressed Ctrl-Space but, in your latest post, you said that you do get some choices when typing “kendo.” and pressing Ctrl-Space. If you get choices shown, what happens when you select one of them?
I’ve tried this with the Open Source version of KendoUI. There is no kendo.all.js with that version, so I used kendo.core.js, which is in the source folder of the kendo open source distribution. That seems to work fine; I can type “kendo.”, press Ctrl-Space and get a list of choices; if I select one of the choices, it gets added to my source.
I’ve downloaded the trial of the full version but there is no kendo.all.js file, only a minimized kendo.all.min.js, which doesn’t appear to be recognized properly when used in a JavaScript user library.
As I say, I’m not familiar with Kendo or how it should be used, in your situation. If you could detail which version you downloaded and how you’ve tried to use it, I might be able to replicate your problem and see if we can figure out what you need to do to get content assist working for you.
Please include screenshots if you think that might help us understand the problem.
joborMemberHello Tony,
Whoh what an effort you made. But I should have said in the first question seeing almost nothing. It tries to show something but in my opinion you get bogus.
A simple auto complete should be done by:
var items = [ { Name: “Item 1” }, { Name: “Item 2”} ];
$(“#autoComplete”).kendoAutoComplete({ dataSource: items });If you type $(“#autoComplete”). and press CTRL+space only jQuery methods and properties appear.
Kendo UI extends in some way jQuery as you can see.
This is part of the web library as open source so you can get the non minified JS files.Pfft coming from Java with code completion. Javascript editing is hard compared to Java.
T.I.A. Johan
support-tonyKeymasterJohan,
I’m not very familiar with JavaScript but it seems that the kendo.autocomplete.js file is coded in a way that makes it very difficult for the editor to figure out what classes and functions are available. It is just a large anonymous function that gets executed immediately. Also, the $(“#autoComplete”) reference seems to be for an object that would only be known at runtime.
I tried this with the eclipse WTP tools (part of the eclipse JEE package), which some of our plug-ins are based on, and see the same issue.
The eclipse forums might be worth posting on to see if there is some way to get more useful functionality here. I’ve also asked our development team to take a look at this to see if they can come up with some suggestions. If they can, a further response will be posted.
I agree that Java is much easier to work with!
joborMemberHello Tony,
I’m also not so very good in Javascript programming that is why good code completion is very helpful. At least you can see what you can do with properties and methods on an object. Otherwise you have to look in the source if you have it and if not than you may hope that there is good documentation.
I tested also with MS Visual Studio 2012 and have to admit that Javascript coding is very good. Also with KendoUI and jQuery.
I hope that MyEclipse can do more with JS user libs. You can define a user lib but it is not guaranteed that every lib shows right in the code completion.
Johan
support-tonyKeymasterJohan,
I’ve raised a problem report for this issue and hope we can improve this behavior for a future release.
Taking the autocomplete example, does MS Visual Studio give the kendoAutoComplete hint at the correct place in the example you gave above?
joborMemberHello Tony,
I tried to do the auto complete in VS Express 2012 Web. It works for Kendo UI.
I have a picture of the code completion. The trick is that you add the JS libs to the JS file via comment lines on top in the file like:/// <reference path=”../lib/jquery/jquery-1.8.0.min.js” />
/// <reference path=”../lib/kendo/js/kendo.all.min.js” />Then the code completion works. In the picture you can also see that kendo is an extension on jQuery as you type:
$(“#autoComplete”).kend CTRL+space
I hope that MyEclipse could provide also the same soft of functionality. More JS libraries are popping up due to the HTML/JS/CSS3 movement.
Thanks,
Johan BorchersAttachments:
You must be logged in to view attached files.
support-tonyKeymasterThanks for that, Johan. This extra information will be useful in our investigations.
-
AuthorPosts