Clear Up
SharpKit Reference

Tool Class

This class is used to display small visual icons in the header of a panel. There are a set of 25 icons that can be specified by using the type config. The handler config can be used to provide a function that will respond to any click events. In general, this class will not be instantiated directly, rather it will be created by specifying the Ext.panel.Panel.tools configuration on the Panel itself.

  
    Ext.create('Ext.panel.Panel', {
            width: 200,
            height: 200,
            renderTo: document.body,
            title: 'A Panel',
            tools: [{
            type: 'help',
            handler: function(){
            // show help here
            }
            }, {
            itemId: 'refresh',
            type: 'refresh',
            hidden: true,
            handler: function(){
            // do refresh
            }
            }, {
            type: 'search',
            handler: function(event, target, owner, tool){
            // do search
            owner.child('#refresh').show();
            }
            }]
            });
            

Namespace: Ext.panel

Constructors

Fields

Name Description
handler A function to execute when the tool is clicked. Arguments passed are:
  • event : Ext.EventObject - The click event.
  • toolEl : Ext.Element - The tool Element.
  • owner : Ext.panel.Header - The host panel header.
  • tool : Ext.panel.Tool - The tool object
  • scope The scope to execute the handler function. Defaults to the tool.
    stopEvent Specify as false to allow click event to propagate. Defaults to: true
    toolOverCls Defaults to: "x-tool-over"
    toolPressedCls Defaults to: "x-tool-pressed"
    tooltip The tooltip for the tool - can be a string to be used as innerHTML (html tags are accepted) or QuickTips config object
    tooltipType The type of tooltip to use. Either 'qtip' (default) for QuickTips or 'title' for title attribute. Defaults to: "qtip"
    type The type of tool to render. The following types are available:
  • close
  • minimize
  • maximize
  • restore
  • toggle
  • gear
  • prev
  • next
  • pin
  • unpin
  • right
  • left
  • down
  • up
  • refresh
  • plus
  • minus
  • search
  • save
  • help
  • print
  • expand
  • collapse
  • Methods

    Name Description
    setType(JsString) Sets the type of the tool. Allows the icon to be changed.
    © Copyright 2005-2011 SharpKit. All rights reserved.