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 grid search


To develop the plugin, we will create a menu where the user can select and deselect the columns of the grid, a text field where the user can write their search query, and a clear button that will help to clear the search query. At first we will develop the required UI fields and then we will add the corresponding functionality to those fields. Now let us start coding:

Ext.define("Examples.plugin.GridSearch", {

  extend : 'Ext.util.Observable',
  alias : 'plugin.gridsearch',

  config : {

    iconCls : 'icon-zoom',
    checkIndexes : "all",
    mode : 'local',
    minChars : 1,
    width : 100,
    searchText : 'Search',
    selectAllText : 'Select all',
    position: 'bottom' ,
    paramNames: {
      fields:'fields'
      ,query:'query'
    }

  },

  init : function(cmp) {

    this.grid = cmp.view.up('gridpanel');

    if (this.grid.rendered)
      this.onRender();
    else {
      this.grid.on('render', this.onRender, this);
    }

  },
…

You can see...