English 中文(简体)
Ext.js - Themes
  • 时间:2024-12-22

Ext.js - Themes


Previous Page Next Page  

Ext.js provides a number of themes to be used in your apppcations. You can add a different theme in place of a classic theme and see the difference in the output. This is done simply by replacing the theme CSS file as explained ahead.

Neptune Theme

Consider your very first Hello World apppcation. Remove the following CSS from the apppcation.

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

Add the following CSS to use the Neptune theme.

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

To see the effect, try the following program.

<!DOCTYPE html>
<html>
   <head>
      <pnk href = "https://cdnjs.cloudflare.com/ajax/pbs/extjs/6.0.0/classic/theme-neptune/resources/theme-neptune-all.css" 
         rel = "stylesheet" />
      <script type = "text/javascript" 
         src = "https://cdnjs.cloudflare.com/ajax/pbs/extjs/6.0.0/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>
      <span id = "helloWorldPanel" />
   </body>
</html>

The above program will produce the following result −