ExtJs 专题
专题目录
您的位置:JS框架 > ExtJs 专题 > Ext.js 主题
Ext.js 主题
作者:--    发布时间:2019-11-20

ext.js提供了许多要在您的应用程序中使用的主题。 你可以添加不同的主题的经典主题,看到输出的差异,这是简单地通过替换主题css文件,如下所述。

考虑你最初的hello world应用程序。 从应用程序中删除以下css:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css



添加以下css以使用海王星主题:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-neptune/resources/theme-neptune-all.css



要查看效果,请尝试以下程序:

<!doctype html>
<html>
   <head>
      <link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-neptune/resources/theme-neptune-all.css" rel="stylesheet" />
      <script type="text/javascript" src="/attachements/w3c/ext-all.js"></script>
      <script type="text/javascript">
         ext.onready(function() {
         ext.create('ext.panel', {
            renderto: 'helloworldpanel',
            height: 200,
            width: 600,
            title: 'hello world',
            html: 'first ext js hello world program'
            });
         });
      </script>
   </head>
   <body>
      <div id="helloworldpanel" />
   </body>
</html>

这会产生以下结果:

neptune theme

crisp theme

考虑你最初的hello world应用程序。 从应用程序中删除以下css:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css



添加以下css以使用海王星主题:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-crisp/resources/theme-crisp-all.css


要查看效果,请尝试以下程序:

<!doctype html>
<html>
   <head>
      <link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-crisp/resources/theme-crisp-all.css" rel="stylesheet" />
      <script type="text/javascript" src="/attachements/w3c/ext-all.js"></script>
      <script type="text/javascript">
         ext.onready(function() {
         ext.create('ext.panel', {
            renderto: 'helloworldpanel',
            height: 200,
            width: 600,
            title: 'hello world',
            html: 'first ext js hello world program'
            });
         });
      </script>
   </head>
   <body>
      <div id="helloworldpanel" />
   </body>
</html>

这会产生以下结果:

crisp theme

triton主题

考虑你最初的hello world应用程序。 从应用程序中删除以下css:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css



添加以下css以使用triton主题:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-triton/resources/theme-triton-all.css


要查看效果,请尝试以下程序:

<!doctype html>
<html>
   <head>
      <link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-triton/resources/theme-triton-all.css" rel="stylesheet" />
      <script type="text/javascript" src="/attachements/w3c/ext-all.js"></script>
      <script type="text/javascript">
         ext.onready(function() {
         ext.create('ext.panel', {
            renderto: 'helloworldpanel',
            height: 200,
            width: 600,
            title: 'hello world',
            html: 'first ext js hello world program'
            });
         });
      </script>
   </head>
   <body>
      <div id="helloworldpanel" />
   </body>
</html>

这会产生以下结果:

crisp theme

gray theme

考虑你最初的hello world应用程序。 从应用程序中删除以下css:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css



添加以下css以使用灰色主题:

https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-gray/resources/theme-gray-all.css



要查看效果,请尝试以下程序:

<!doctype html>
<html>
   <head>
      <link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-gray/resources/theme-gray-all.css" rel="stylesheet" />
      <script type="text/javascript" src="/attachements/w3c/ext-all.js"></script>
      <script type="text/javascript">
         ext.onready(function() {
         ext.create('ext.panel', {
            renderto: 'helloworldpanel',
            height: 200,
            width: 600,
            title: 'hello world',
            html: 'first ext js hello world program'
            });
         });
      </script>
   </head>
   <body>
      <div id="helloworldpanel" />
   </body>
</html>

这会产生以下结果:

gray theme

网站声明:
本站部分内容来自网络,如您发现本站内容
侵害到您的利益,请联系本站管理员处理。
联系站长
373515719@qq.com
关于本站:
编程参考手册