Book Image

Ext JS 4 Plugin and Extension Development

By : Abdullah Al Mohammad
Book Image

Ext JS 4 Plugin and Extension Development

By: Abdullah Al Mohammad

Overview of this book

Ext JS is a pure JavaScript application framework for building interactive web applications using techniques such as Ajax, DHTML, and DOM scripting. Ext JS 4 Plugin and Extension Development is a practical, step-by-step tutorial which guides you to learn and develop ExtJS plugins and extensions. There are a lot of examples with explanations and plenty of code provided to make it easier and quicker to pick up. Starting with the fundamentals, this book introduces some of the ExtJS library and community provided plugins and extensions and finishes with several hands-on, real world development examples. You will get a clear concept of ExtJS plugins and extensions and learn how to use them. You will also learn how to develop an ExtJS plugin and extension by going through several examples with code and screenshots. Ext JS 4 Plugin and Extension Development book will provide you with the knowledge to develop ExtJS plugins and extensions using real-life examples.
Table of Contents (16 chapters)
Ext JS 4 Plugin and Extension Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Planning and coding the message bar


To develop this extension, we can use the Ext JS toolbar and dock it to the bottom of the container. Then we can add a functionality where this toolbar can show the message text. Then we need to add a functionality when the message bar is called to show the message; the message bar appears and disappears when the close button is clicked upon or when the configured timer is completed. As per our functional requirement, we can see that the Ext JS library provided StatusBar extension is doing a lot that we needed to provide functionality for this message bar extension. So, we can modify that extension and add our own functionality and CSS styles to fulfill our requirement. Now let us start coding:

Ext.define('Examples.ux.MessageBar', {
  extend: 'Ext.toolbar.Toolbar',
  alias: 'widget.ux-msgbar',
  activeThreadId: 0,
  dock: 'bottom',
  config: {
    cls: 'x-messagebar',
    emptyText: '',
    defaultText: '',
    autoClear: 5000
  },


  initComponent: function...