Book Image

Ext JS 3.0 Cookbook

Book Image

Ext JS 3.0 Cookbook

Overview of this book

Using Ext JS you can easily build desktop-style interfaces in your web applications. Over 400,000 developers are working smarter with Ext JS and yet most of them fail to exercise all of the features that this powerful JavaScript library has to offer. Get to grips with all of the features that you would expect with this quick and easy-to-follow Ext JS Cookbook. This book provides clear instructions for getting the most out of Ext JS with and offers many exercises to build impressive rich internet applications. This cookbook shows techniques and "patterns" for building particular interface styles and features in Ext JS. Pick what you want and move ahead. It teaches you how to use all of the Ext JS widgets and components smartly, through practical examples and exercises. Native and custom layouts, forms, grids, listviews, treeviews, charts, tab panels, menus, toolbars, and many more components are covered in a multitude of examples.The book also looks at best practices on data storage, application architecture, code organization, presenting recipes for improving themóour cookbook provides expert information for people working with Ext JS.
Table of Contents (15 chapters)
Ext JS 3.0 Cookbook
Credits
About the Author
About the Reviewer
Preface

Enhancing a TabPanel with plugins: The TabScroller menu


The TabScrollerMenu plugin is another example of how to extend a component's features. Used on a TabPanel, this plugin builds a menu that provides easy access to any of the tabs without having to resort to the panel's default tab-scrolling behavior, as seen below:

Getting ready...

Obtain the TabScrollerMenu.js, tab-scroller-menu.gif, and tab-scroller-menu.css files from the Ext JS samples page at http://extjs.com/deploy/dev/examples/tabs/ tab-scroller-menu.html.

How to do it...

  1. 1. Create the styles for the button and tabs:

    icon-new-tab
    {
    background:url(img/add2.png) 0 no-repeat !important;
    }
    icon-tab
    {
    background:url(img/star-yellow.png) 0 no-repeat !important;
    }
    
  2. 2. Include the styles used in the TabScrollerMenu plugin:

    <link href="tab-scroller-menu.css" rel="stylesheet" type="text/css" />
    
  3. 3. Include the TabScrollerMenu plugin file:

    <script src="TabScrollerMenu.js" type="text/javascript"></script>
    
  4. 4. Create an instance of...