Class YAHOO.ext.grid.AbstractDataModel
This abstract class provides default implementations of the events required by the Grid.
It takes care of the creating the CustomEvents and provides some convenient methods for firing the events.
Public Properties
This class has no public properties.
Public Methods
|
AbstractDataModel() |
AbstractDataModel |
|
|
addListener(String eventName , Function handler , [Object scope ], [boolean override ]) : void |
Observable |
Appends an event handler to this component |
|
bufferedListener(String eventName , Function handler , [Object scope ], [Number millis ]) : Function |
Observable |
Appends an event handler to this component that is buffered. If the event is triggered more than once
in the specifie... |
|
delayedListener(String eventName , Function handler , [Object scope ], [Number delay ]) : Function |
Observable |
Appends an event handler to this component that is delayed the specified number of milliseconds. This
is useful for e... |
|
fireEvent(String eventName , Object... args ) : Boolean |
Observable |
Fires the specified event with the passed parameters (minus the event name). |
|
getSortState() : Object |
AbstractDataModel |
Interface method to supply info regarding the Grid's current sort state - if overridden,
this should return an object... |
|
on(String eventName , Function handler , [Object scope ], [boolean override ]) : void |
Observable |
Appends an event handler to this element (shorthand for addListener) |
|
purgeListeners() : void |
Observable |
Removes all listeners for this object |
|
removeListener(String eventName , Function handler , [Object scope ]) : void |
Observable |
Removes a listener |
Public Events
|
cellupdated : (DataModel this , Number rowIndex , Number columnIndex ) |
AbstractDataModel |
Fires when a cell is updated |
|
datachanged : (DataModel this ) |
AbstractDataModel |
Fires when the entire data structure has changed |
|
rowsdeleted : (DataModel this , Number firstRowIndex , Number lastRowIndex ) |
AbstractDataModel |
Fires when a range of rows have been deleted |
|
rowsinserted : (DataModel this , Number firstRowIndex , Number lastRowIndex ) |
AbstractDataModel |
Fires when a range of rows have been inserted |
|
rowssorted : (DataModel this ) |
AbstractDataModel |
Fires when the data has been sorted |
|
rowsupdated : (DataModel this , Number firstRowIndex , Number lastRowIndex ) |
AbstractDataModel |
Fires when a range of rows have been updated |
Constructor Details
AbstractDataModel
public function AbstractDataModel()
Method Details
addListener
public function addListener(String eventName
, Function handler
, [Object scope
], [boolean override
])
Appends an event handler to this component
Parameters:
eventName
: StringThe type of event to listen for
handler
: FunctionThe method the event invokes
scope
: Object(optional) The scope (this object) for the handler
override
: boolean(optional) If true, scope becomes the scope
Returns:
bufferedListener
public function bufferedListener(String eventName
, Function handler
, [Object scope
], [Number millis
])
Appends an event handler to this component that is buffered. If the event is triggered more than once
in the specified time-frame, only the last one actually fires.
Parameters:
eventName
: StringThe type of event to listen for
handler
: FunctionThe method the event invokes
scope
: Object(optional) The scope (this object) for the handler
millis
: Number(optional) The number of milliseconds to buffer (defaults to 250)
Returns:
delayedListener
public function delayedListener(String eventName
, Function handler
, [Object scope
], [Number delay
])
Appends an event handler to this component that is delayed the specified number of milliseconds. This
is useful for events that modify the DOM and need to wait for the browser to catch up.
Parameters:
eventName
: StringThe type of event to listen for
handler
: FunctionThe method the event invokes
scope
: Object(optional) The scope (this object) for the handler
delay
: Number(optional) The number of milliseconds to delay (defaults to 1 millisecond)
Returns:
fireEvent
public function fireEvent(String eventName
, Object... args
)
Fires the specified event with the passed parameters (minus the event name).
getSortState
public function getSortState()
Interface method to supply info regarding the Grid's current sort state - if overridden,
this should return an object like this {column: this.sortColumn, direction: this.sortDir}.
This method is defined by AbstractDataModel.
on
public function on(String eventName
, Function handler
, [Object scope
], [boolean override
])
Appends an event handler to this element (shorthand for addListener)
Parameters:
eventName
: StringThe type of event to listen for
handler
: FunctionThe method the event invokes
scope
: Object(optional) The scope (this object) for the handler
override
: boolean(optional) If true, scope becomes the scope
Returns:
purgeListeners
public function purgeListeners()
Removes all listeners for this object
removeListener
public function removeListener(String eventName
, Function handler
, [Object scope
])
Event Details
cellupdated
public event cellupdated
Fires when a cell is updated
Subscribers will be called with the following parameters:
this
: DataModelrowIndex
: NumbercolumnIndex
: Number
This event is defined by AbstractDataModel.
datachanged
public event datachanged
Fires when the entire data structure has changed
Subscribers will be called with the following parameters:
This event is defined by AbstractDataModel.
rowsdeleted
public event rowsdeleted
Fires when a range of rows have been deleted
Subscribers will be called with the following parameters:
this
: DataModelfirstRowIndex
: NumberlastRowIndex
: Number
This event is defined by AbstractDataModel.
rowsinserted
public event rowsinserted
Fires when a range of rows have been inserted
Subscribers will be called with the following parameters:
this
: DataModelfirstRowIndex
: NumberlastRowIndex
: Number
This event is defined by AbstractDataModel.
rowssorted
public event rowssorted
Fires when the data has been sorted
Subscribers will be called with the following parameters:
This event is defined by AbstractDataModel.
rowsupdated
public event rowsupdated
Fires when a range of rows have been updated
Subscribers will be called with the following parameters:
this
: DataModelfirstRowIndex
: NumberlastRowIndex
: Number
This event is defined by AbstractDataModel.
yui-ext - Copyright © 2006 Jack Slocum. |
Yahoo! UI - Copyright © 2006 Yahoo! Inc.
All rights reserved.