最近项目中用到了ext,所以打算较为系统的学习下。网上关于ext4的教程较多,所以决定从4学起。习惯了带有提示的工具后,只靠看API敲代码,总是有一种不安全感。所以也百度了下js提示工具,结果遇到了各种问题:

一、Extjs下载

  中文站:http://extjs.org.cn/

  英文站:http://www.sencha.com/products/extjs/

二、spket插件安装

      http://www.spket.com/

  插件安装的方法就不多说了,官网有详细教程。

三、插件配置

  首先,需要下载相关的提示引导文件,后缀一般是.jsb,.jsb2,.jsb3等等。

  可以到Ext的build文件中找找看,没有的话到spket官网看看,最新的是ext5,官网已有更新。

注意:下载下来后,注意该文件放的位置。有的需要在Ext根目录下,有的需要在bulid下,不确定的话,可以看看里面源码中链接 js文件的相对路径来确定

接下来就要把文件配置到工具中,让Myeclipse智能起来,这里借用官网的教程:

Create JavaScript profile for Ext 4.x

  1. Download Ext 4.x, unzip it, do not delete the src folder..
  2. Select the menu item Window > Preferences... to open the workbench preferences.
  3. Select the Spket > JavaScript Profile preference page to display the installed JavaScript Profiles.
  4. Click the New.. button. In the Name field, type Ext 4 as the name for the new profile. Then click OK.
  5. Click the Add Library button. From the Library drop-down list, select ExtJS. Then click OK.
  6. Click the Add File button, choose sdk.jsb3 which can be found in build folder.
  7. Select the Ext profile created in step 4, click the Default button make it the default profile for all project. The default profile can also be configured per project by using Configure Project Specific Settings... link.
  8. If everything done correctly, your profile should looks like this.
  9. Click on OK to save the preferences.
  10. Open javascript file with Spket JavaScript Editor. If you not sure which editor you used, take a look at this screen shot. click Ctrl+Space or Alt+/, the code assist window will looks like this if there is no code.

下面是设置完成后的截图:

这里,一定要注意上面的第10条,非常的关键!!一定要使用Spket JavaScript Editor 编辑器才可以。否则提示不全。看下面:

在html中死活没有Ext.Viewport的提示,但在Spket JavaScript Editor中轻轻松松

 

至此,提示问题终于解决~