This is an implementation of a DataModel used by the Grid. It works
with JSON data.
Example schema:
var schema = {
root: 'Results.Result',
id: 'ASIN',
fields: ['Author', 'Title', 'Manufacturer', 'ProductGroup']
};
|
addListener : Object |
AbstractDataModel |
Inherited from Observable |
|
baseParams : Object |
LoadableDataModel |
An object of key/value pairs to be passed as parameters
when loading pages/sorting |
|
delayedListener : Object |
AbstractDataModel |
Inherited from Observable |
|
fireEvent : Object |
AbstractDataModel |
Inherited from Observable |
|
loadedPage : Number |
LoadableDataModel |
The active page |
|
on : Object |
AbstractDataModel |
Inherited from Observable |
|
onCellUpdated : YAHOO.util.CustomEvent |
AbstractDataModel |
Deprecated. Fires when a cell is updated - fireDirect sig: (this, rowIndex, columnIndex) |
|
onLoad : YAHOO.util.CustomEvent |
LoadableDataModel |
Deprecated. Fires when a successful load is completed - fireDirect sig: (this) |
|
onLoadException : YAHOO.util.CustomEvent |
LoadableDataModel |
Deprecated. Fires when a load fails - fireDirect sig: (this, errorMsg, responseObj) |
|
onRowsDeleted : YAHOO.util.CustomEvent |
AbstractDataModel |
Deprecated. Fires when rows are deleted - fireDirect sig: (this, firstRowIndex, lastRowIndex) |
|
onRowsInserted : YAHOO.util.CustomEvent |
AbstractDataModel |
Deprecated. Fires when a rows are inserted - fireDirect sig: (this, firstRowIndex, lastRowIndex) |
|
onRowsSorted : YAHOO.util.CustomEvent |
AbstractDataModel |
Deprecated. Fires when a sort has reordered the rows - fireDirect sig: (this, sortColumnIndex,
sortDirection = 'ASC'... |
|
onRowsUpdated : YAHOO.util.CustomEvent |
AbstractDataModel |
Deprecated. Fires when a rows are updated - fireDirect sig: (this, firstRowIndex, lastRowIndex) |
|
onTableDataChanged : YAHOO.util.CustomEvent |
AbstractDataModel |
Deprecated. Fires when all data needs to be revalidated - fireDirect sig: (thisd) |
|
pageSize : Number |
LoadableDataModel |
The number of records per page |
|
pageUrl : String |
LoadableDataModel |
The script/page to call to provide paged/sorted data |
|
paramMap : Object |
LoadableDataModel |
Maps named params to url parameters - Override to specify your own param names |
|
remoteSort : Boolean |
LoadableDataModel |
True to use remote sorting, initPaging automatically sets this to true |
|
removeListener : Object |
AbstractDataModel |
Inherited from Observable |
|
JSONDataModel() |
JSONDataModel |
|
|
addPostprocessor() : void |
LoadableDataModel |
Adds a postprocessor function to format data before updating the underlying data source (ie. convert date to string b... |
|
addPreprocessor() : void |
LoadableDataModel |
Adds a preprocessor function to parse data before it is added to the Model - ie. Date.parse to parse dates. |
|
addRow(Array cellValues ) : Number |
DefaultDataModel |
Adds a row to the dataset. |
|
applySort() : void |
DefaultDataModel |
Applies the last used sort to the current data. |
|
each() : void |
DefaultDataModel |
Calls passed function with each rows data - if the function returns false it stops. |
|
filter(Object query ) : Number |
DefaultDataModel |
Filter the DataModel rows by the query defined in spec, see query for more details
on the query spec. |
|
fireCellUpdated() : void |
AbstractDataModel |
Notifies listeners that the value of the cell at [row, col] has been updated |
|
fireRowsDeleted() : void |
AbstractDataModel |
Notifies listeners that rows in the range [firstRow, lastRow], inclusive, have been deleted |
|
fireRowsInserted() : void |
AbstractDataModel |
Notifies listeners that rows in the range [firstRow, lastRow], inclusive, have been inserted |
|
fireRowsSorted() : void |
AbstractDataModel |
Notifies listeners that rows have been sorted and any indexes may be invalid |
|
fireRowsUpdated() : void |
AbstractDataModel |
Notifies listeners that rows in the range [firstRow, lastRow], inclusive, have been updated |
|
fireTableDataChanged() : void |
AbstractDataModel |
Notifies listeners that all data for the grid may have changed - use as a last resort. This
also wipes out all selec... |
|
getPageSize() : void |
LoadableDataModel |
Returns the number of records per page |
|
getPostprocessor() : void |
LoadableDataModel |
Gets the postprocessor function for the specified column. |
|
getPreprocessor() : void |
LoadableDataModel |
Gets the preprocessor function for the specified column. |
|
getRow() : Array |
DefaultDataModel |
Returns the column data for the specified row. |
|
getRowCount() : void |
AbstractDataModel |
Empty interface method - Classes which extend AbstractDataModel should implement this method.
See YAHOO.ext.DefaultDa... |
|
getRowId(Number rowIndex ) : Number |
JSONDataModel |
Overrides getRowId in DefaultDataModel to return the ID value of the specified node. |
|
getRows(Array indexes ) : Array |
DefaultDataModel |
Returns the column data for the specified rows as a
multi-dimensional array: rows[3][0] would give you the value of ... |
|
getSortState() : Object |
AbstractDataModel |
Interface method to supply the view with info regarding the Grid's current sort state - if overridden,
this should re... |
|
getTotalPages() : void |
LoadableDataModel |
Returns the total number of pages available |
|
getTotalRowCount() : void |
AbstractDataModel |
Empty interface method - Classes which extend AbstractDataModel should implement this method to support virtual row c... |
|
getValueAt() : void |
AbstractDataModel |
Empty interface method - Classes which extend AbstractDataModel should implement this method.
See YAHOO.ext.DefaultDa... |
|
initPaging() : void |
LoadableDataModel |
Initializes paging for this model. |
|
insertRow(Number index , Array cellValues ) : Number |
DefaultDataModel |
Inserts a row a the specified location in the dataset. |
|
isPaged() : void |
LoadableDataModel |
Returns true if this model uses paging |
|
load(Object/String url , [String/Object params ], [Function callback ], [Number insertIndex ]) : void |
LoadableDataModel |
Initiates the loading of the data from the specified URL - Failed load attempts will
fire the onLoadException event. |
|
loadData(Object data , Function callback ) : void |
JSONDataModel |
Overrides loadData in LoadableDataModel to process JSON data |
|
query(Object spec , Boolean returnUnmatched ) : Array |
DefaultDataModel |
Query the DataModel rows by the filters defined in spec, for example...
// column 1 starts with Jack, column 2 filte... |
|
removePostprocessor() : void |
LoadableDataModel |
Removes a postprocessor function. |
|
removePreprocessor() : void |
LoadableDataModel |
Removes a preprocessor function. |
|
removeRow(Number index ) : void |
DefaultDataModel |
Remove a row. |
|
setValueAt() : void |
AbstractDataModel |
Empty interface method - Classes which extend AbstractDataModel should implement this method.
See YAHOO.ext.DefaultDa... |
|
sort() : void |
AbstractDataModel |
Empty interface method - Classes which extend AbstractDataModel should implement this method.
See YAHOO.ext.DefaultDa... |
This class has no public events.
addListener
public Object addListener
Inherited from Observable
baseParams
public Object baseParams
An object of key/value pairs to be passed as parameters
when loading pages/sorting
delayedListener
public Object delayedListener
Inherited from Observable
fireEvent
public Object fireEvent
Inherited from Observable
loadedPage
public Number loadedPage
The active page
on
public Object on
Inherited from Observable
onCellUpdated
public YAHOO.util.CustomEvent onCellUpdated
Deprecated. Fires when a cell is updated - fireDirect sig: (this, rowIndex, columnIndex)
onLoad
public YAHOO.util.CustomEvent onLoad
Deprecated. Fires when a successful load is completed - fireDirect sig: (this)
onLoadException
public YAHOO.util.CustomEvent onLoadException
Deprecated. Fires when a load fails - fireDirect sig: (this, errorMsg, responseObj)
onRowsDeleted
public YAHOO.util.CustomEvent onRowsDeleted
Deprecated. Fires when rows are deleted - fireDirect sig: (this, firstRowIndex, lastRowIndex)
onRowsInserted
public YAHOO.util.CustomEvent onRowsInserted
Deprecated. Fires when a rows are inserted - fireDirect sig: (this, firstRowIndex, lastRowIndex)
onRowsSorted
public YAHOO.util.CustomEvent onRowsSorted
Deprecated. Fires when a sort has reordered the rows - fireDirect sig: (this, sortColumnIndex,
sortDirection = 'ASC' or 'DESC')
onRowsUpdated
public YAHOO.util.CustomEvent onRowsUpdated
Deprecated. Fires when a rows are updated - fireDirect sig: (this, firstRowIndex, lastRowIndex)
onTableDataChanged
public YAHOO.util.CustomEvent onTableDataChanged
Deprecated. Fires when all data needs to be revalidated - fireDirect sig: (thisd)
pageSize
public Number pageSize
The number of records per page
pageUrl
public String pageUrl
The script/page to call to provide paged/sorted data
paramMap
public Object paramMap
Maps named params to url parameters - Override to specify your own param names
remoteSort
public Boolean remoteSort
True to use remote sorting, initPaging automatically sets this to true
removeListener
public Object removeListener
Inherited from Observable