Package: | Ext |
Class: | GridPanel |
Extends: | ContentPanel |
Defined In: | ContentPanels.js |
Method | Defined By | |
---|---|---|
GridPanel( Ext.grid.Grid grid , String/Object config ) |
GridPanel | |
Create a new GridPanel. | ||
addEvents( Object object ) : void |
Observable | |
Used to define events on this Observable | ||
addListener( String eventName , Function handler , [Object scope ], [Object options ] ) : void |
Observable | |
Appends an event handler to this component | ||
destroy() : void | ContentPanel | |
Destroys this panel | ||
fireEvent( String eventName , Object... args ) : Boolean |
Observable | |
Fires the specified event with the passed parameters (minus the event name). | ||
getEl() : Ext.Element | ContentPanel | |
Returns this panel's element | ||
getGrid() : Ext.grid.Grid | GridPanel | |
Returns the grid for this panel | ||
getId() : String | ContentPanel | |
Returns this panel's id | ||
getTitle() : String | ContentPanel | |
Returns this panel's title | ||
getToolbar() : Ext.Toolbar | ContentPanel | |
Returns the toolbar for this Panel if one was configured. | ||
getUpdateManager() : Ext.UpdateManager | ContentPanel | |
Get the Ext.UpdateManager for this panel. Enables you to perform Ajax updates. | ||
hasListener( String eventName ) : Boolean |
Observable | |
Checks to see if this object has any listeners for a specified event | ||
isClosable() : Boolean | ContentPanel | |
Returns true is this panel was configured to be closable | ||
load( Object/String/Function url , [String/Object params ], [Function callback ], [Boolean discardUrl ] ) : Ext.ContentPanel |
ContentPanel | |
Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use ... | ||
on( String eventName , Function handler , [Object scope ], [Object options ] ) : void |
Observable | |
Appends an event handler to this element (shorthand for addListener) | ||
purgeListeners() : void | Observable | |
Removes all listeners for this object | ||
refresh() : void | ContentPanel | |
Force a content refresh from the URL specified in the setUrl method. Will fail silently if the setUrl method has not ... | ||
removeListener( String eventName , Function handler , [Object scope ] ) : void |
Observable | |
Removes a listener | ||
setContent( String content , [Boolean loadScripts ] ) : void |
ContentPanel | |
Updates this panel's element | ||
setTitle( String title ) : void |
ContentPanel | |
Set this panel's title | ||
setUrl( String/Function url , [String/Object params ], [Boolean loadOnce ] ) : Ext.UpdateManager |
ContentPanel | |
Set a URL to be used to load the content for this panel. When this panel is activated, the content will be loaded fro... | ||
un( String eventName , Function handler , [Object scope ] ) : void |
Observable | |
Removes a listener (shorthand for removeListener) |
Event | Defined By | |
---|---|---|
activate : ( Ext.ContentPanel this ) |
ContentPanel | |
Fires when this panel is activated. | ||
deactivate : ( Ext.ContentPanel this ) |
ContentPanel | |
Fires when this panel is activated. | ||
resize : ( Ext.ContentPanel this , Number width , Number height ) |
ContentPanel | |
Fires when this panel is resized if fitToFrame is true. |
Config Options | Defined By | |
---|---|---|
adjustments : Array | ContentPanel | |
Values to add to the width/height when doing a fitToFrame (default is [0, 0]) | ||
autoCreate : Boolean/Object | ContentPanel | |
True to auto generate the DOM element for this panel, or a Ext.DomHelper config of the element to create | ||
autoScroll : Boolean | ContentPanel | |
True to scroll overflow in this panel (use with fitToFrame) | ||
background : Boolean | ContentPanel | |
True if the panel should not be activated when it is added (defaults to false) | ||
closable : Boolean | ContentPanel | |
True if the panel can be closed/removed | ||
fitContainer : Boolean | ContentPanel | |
When using fitToFrame and resizeEl, you can also fit the parent container (defaults to false) | ||
fitToFrame : Boolean | ContentPanel | |
True for this panel to adjust its size to fit when the region resizes (defaults to false) | ||
loadOnce : Boolean | ContentPanel | |
When used with url, calls setUrl with this value | ||
params : String/Object | ContentPanel | |
When used with url, calls setUrl with this value | ||
resizeEl : String/HTMLElement/Element | ContentPanel | |
An element to resize if fitToFrame is true (instead of this panel's element) | ||
title : String | ContentPanel | |
The title for this panel | ||
toolbar : Toolbar | ContentPanel | |
A toolbar for this panel | ||
url : String | ContentPanel | |
Calls setUrl with this value |
public function GridPanel( Ext.grid.Grid grid
, String/Object config
)
grid
: Ext.grid.Gridconfig
: String/Objectpublic function addEvents( Object object
)
object
: Objectvoid
public function addListener( String eventName
, Function handler
, [Object scope
], [Object options
] )
eventName
: Stringhandler
: Functionscope
: Objectoptions
: Object
Combining Options
Using the options argument, it is possible to combine different types of listeners:
A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
el.on('click', this.onClick, this, {
single: true,
delay: 100,
forumId: 4
});
Attaching multiple handlers in 1 call
The method also allows for a single argument to be passed which is a config object containing properties
which specify multiple handlers.
el.on({
'click': {
fn: this.onClick,
scope: this,
delay: 100
},
'mouseover': {
fn: this.onMouseOver,
scope: this
},
'mouseout': {
fn: this.onMouseOut,
scope: this
}
});
Or a shorthand syntax which passes the same scope object to all handlers:
el.on({
'click': this.onClick,
'mouseover': this.onMouseOver,
'mouseout': this.onMouseOut,
scope: this
});
void
public function destroy()
void
public function fireEvent( String eventName
, Object... args
)
eventName
: Stringargs
: Object...Boolean
public function getEl()
Ext.Element
public function getGrid()
Ext.grid.Grid
public function getId()
String
public function getTitle()
String
public function getToolbar()
Ext.Toolbar
public function getUpdateManager()
Ext.UpdateManager
public function hasListener( String eventName
)
eventName
: StringBoolean
public function isClosable()
Boolean
public function load( Object/String/Function url
, [String/Object params
], [Function callback
], [Boolean discardUrl
] )
url
: Object/String/Functionpanel.load({
url: "your-url.php",
params: {param1: "foo", param2: "bar"}, // or a URL encoded string
callback: yourFunction,
scope: yourObject, //(optional scope)
discardUrl: false,
nocache: false,
text: "Loading...",
timeout: 30,
scripts: false
});
The only required property is url. The optional properties nocache, text and scripts
are shorthand for disableCaching, indicatorText and loadScripts and are used to set their associated property on this panel UpdateManager instance.params
: String/Objectcallback
: FunctiondiscardUrl
: BooleanExt.ContentPanel
public function on( String eventName
, Function handler
, [Object scope
], [Object options
] )
eventName
: Stringhandler
: Functionscope
: Objectoptions
: Objectvoid
public function purgeListeners()
void
public function refresh()
void
public function removeListener( String eventName
, Function handler
, [Object scope
] )
eventName
: Stringhandler
: Functionscope
: Objectvoid
public function setContent( String content
, [Boolean loadScripts
] )
content
: StringloadScripts
: Booleanvoid
public function setTitle( String title
)
title
: Stringvoid
public function setUrl( String/Function url
, [String/Object params
], [Boolean loadOnce
] )
url
: String/Functionparams
: String/ObjectloadOnce
: BooleanExt.UpdateManager
public function un( String eventName
, Function handler
, [Object scope
] )
eventName
: Stringhandler
: Functionscope
: Objectvoid
public event activate
this
: Ext.ContentPanelpublic event deactivate
this
: Ext.ContentPanelpublic event resize
this
: Ext.ContentPanelwidth
: Numberheight
: Numberadjustments : Array
autoCreate : Boolean/Object
autoScroll : Boolean
background : Boolean
closable : Boolean
fitContainer : Boolean
fitToFrame : Boolean
resizeEl : String/HTMLElement/Element