不使用Sencha Cmd,创建EXT-JS应用

来源:互联网 发布:相思相见知何日 编辑:程序博客网 时间:2024/05/01 02:55

尽管建议使用Sencha Cmd创建EXT-JS应用,但是,你完全可以不使用Sencha Cmd,也可以创建EXT-JS应用。只需要在你的index.html的文件头中包含EXT-JS框架的库文件,主题样式表文件和重载的主题样式表文件。

在EXT-JS中,主题样式表文件和重载的主题样式表文件以package创建,在EXT JS 5中,这些主题样式表文件位于“{ExtJS-5-SDK}/packages/”,它们是:

  • ext-theme-base (用于框架,不必直接设置)
  • ext-theme-neutral (创建自定义主题时使用,不必直接设置)
  • ext-theme-classic
  • ext-theme-gray
  • ext-theme-neptune
  • ext-theme-neptune-touch (为 tablet优化)
  • ext-theme-crisp
  • ext-theme-crisp-touch (为 tablet优化)

在EXT JS 6中,主题分为两类, classic 和 modern。classic主题文件位于“{ExtJS-6-SDK}/classic/”,它们是:

  • theme-base (用于框架,不必直接设置)
  • theme-neutral (创建自定义主题时使用,不必直接设置)
  • theme-classic
  • theme-gray
  • theme-neptune
  • theme-neptune-touch (为 tablet优化)
  • theme-crisp
  • theme-crisp-touch (为 tablet优化)
  • theme-triton

modern主题文件位于 “{ExtJS-6-SDK}/modern/” ,它们是:

  • theme-base (用于框架,不必直接设置)
  • theme-blackberry
  • theme-cupertino
  • theme-cupertino-classic
  • theme-mountainview
  • theme-neptune
  • theme-windows

注意,使用Sencha Cmd创建应用的好处是,只包含了应用所需要的文件,使得应用是轻量级的,快速响应的,整洁的。


最好把ext js6库部署到服务器上,否则,Eclipse验证会让你头痛的。示例index.html如下:

<html>
    <head>
        <title>Welcome to Ext JS!</title>
        <link rel="stylesheet" type="text/css"
            href="http://localhost:8080/ext6/classic/theme-neptune/resources/theme-neptune-all.css">
        <script type="text/javascript" src="http://localhost:8080/ext6/ext-all.js"></script>
        <script type="text/javascript"
            src="http://localhost:8080/ext6/classic/theme-neptune/theme-neptune.js"></script>

        <script type="text/javascript" src="app.js"></script>
    </head>
    <body></body>
</html>


0 0
原创粉丝点击