- Ext.js - Home
- Ext.js - Overview
- Ext.js - Environment Setup
- Ext.js - Naming Convention
- Ext.js - Architecture
- Ext.js - First Program
- Ext.js - Class System
- Ext.js - Containers
- Ext.js - Layouts
- Ext.js - Components
- Ext.js - Drag & Drop
- Ext.js - Themes
- Ext.js - Custom Events and Listeners
- Ext.js - Data
- Ext.js - Fonts
- Ext.js - Style
- Ext.js - Drawing
- Ext.js - Localization
- Ext.js - Accessibility
- Ext.js - Debugging Code
- Ext.js - Methods
Ext.js - Font-Awesome Triton Theme
With the Triton theme, we do not need any explicit requirement of font-awesome stylesheet. We can directly use font-awesome classes as font-awesome is included in the Triton theme inbuilt.
Syntax
Just add font-awesome class to iconCls as −
iconCls : 'fa fa-car'
Example
Following is a simple example to add font-awesome class.
<!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 = "https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
<script type = "text/javascript">
Ext.onReady(function() {
Ext.create('Ext.container.Container', {
renderTo : Ext.getBody(),
layout : 'auto' ,
width : 600,
items : [{
xtype : 'button',
iconCls : 'fa fa-car',
text : 'Browse Fil1e'
},{
xtype : 'button',
iconCls : 'fa fa-file',
text : 'Browse File3'
},{
xtype : 'button',
iconCls : 'fa fa-home',
text : 'Browse File4'
},{
xtype : 'button',
iconCls : 'fa fa-folder',
text : 'Browse File5'
}]
});
});
</script>
</head>
<body>
<div id = "panel" > </div>
</body>
</html>
The above program will produce the following result −
extjs_fonts.htm
Advertisements