Class YAHOO.ext.grid.XMLDataModel

Object
   |
   +--YAHOO.ext.grid.AbstractDataModel
         |
         +--YAHOO.ext.grid.DefaultDataModel
               |
               +--YAHOO.ext.grid.LoadableDataModel
                     |
                     +--YAHOO.ext.grid.XMLDataModel

class YAHOO.ext.grid.XMLDataModel
extends YAHOO.ext.grid.LoadableDataModel


This is an implementation of a DataModel used by the Grid. It works with XML data.
Example schema from Amazon search:


 var schema = {
     tagName: 'Item',
     id: 'ASIN',
     fields: ['Author', 'Title', 'Manufacturer', 'ProductGroup']
 };
 

Defined in XMLDataModel.js


Field Summary
 Object xml
  
   
Fields inherited from class YAHOO.ext.grid.LoadableDataModel
onLoad, onLoadException, loadedPage, remoteSort, pageSize, pageUrl, baseParams, paramMap
   
Fields inherited from class YAHOO.ext.grid.AbstractDataModel
onCellUpdated, onTableDataChanged, onRowsDeleted, onRowsInserted, onRowsUpdated, onRowsSorted, events, addListener, removeListener, fireEvent
 
Constructor Summary
YAHOO.ext.grid.XMLDataModel (<Object> schema, <XMLDocument> xml)
  
 
Method Summary * Parameter types in italic indicate optional parameters
 Number addRow(<String> id, <Array> cellValues)
   Adds a row to this DataModel and syncs the XML document
 XMLNode createNode(<XMLDocument> xmlDoc, id, <Array> colData)
   Override this method to define your own node creation routine for when new rows are added.
 Object getDocument()
  
 Object getNamedValue(node, name, defaultValue)
   Convenience function looks for value in attributes, then in children tags - also normalizes namespace matches (ie matches ns:tag, FireFox matches tag and not ns:tag).
 Object getNode(rowIndex)
  
 Number getRowId(<Number> rowIndex)
   Overrides getRowId in DefaultDataModel to return the ID value of the specified node.
 Number insertRow(<Number> index, <String> id, <Array> cellValues)
   Inserts a row into this DataModel and syncs the XML document
 void loadData(<XMLDocument> doc, <Function> callback, <Boolean> keepExisting, <Number> insertIndex)
   Overrides loadData in LoadableDataModel to process XML
 void removeRow(<Number> index)
   Removes the row from DataModel and syncs the XML document
 void setNamedValue(node, name, value)
   Convenience function set a value in the underlying xml node.
 void setValueAt(<Object> value, <Number> rowIndex, <Number> colIndex)
   Overrides DefaultDataModel.setValueAt to update the underlying XML Document
 
Methods inherited from class YAHOO.ext.grid.LoadableDataModel
isPaged, getTotalRowCount, getPageSize, getTotalPages, initPaging, loadPage, sort, load, fireLoadException, fireLoadEvent, addPreprocessor, getPreprocessor, removePreprocessor, addPostprocessor, getPostprocessor, removePostprocessor
   
Methods inherited from class YAHOO.ext.grid.DefaultDataModel
getRowCount, getRow, getRows, getValueAt, query, filter, applySort, setDefaultSort
   
Methods inherited from class YAHOO.ext.grid.AbstractDataModel
fireCellUpdated, fireTableDataChanged, fireRowsDeleted, fireRowsInserted, fireRowsUpdated, fireRowsSorted, getSortState
 

Field Detail

xml

Object xml

Constructor Detail

YAHOO.ext.grid.XMLDataModel

YAHOO.ext.grid.XMLDataModel(<Object> schema, <XMLDocument> xml)

Method Detail

addRow

Number addRow(<String> id, <Array> cellValues)

createNode

XMLNode createNode(<XMLDocument> xmlDoc, id, <Array> colData)

getDocument

Object getDocument()

getNamedValue

Object getNamedValue(node, name, defaultValue)

getNode

Object getNode(rowIndex)

getRowId

Number getRowId(<Number> rowIndex)

insertRow

Number insertRow(<Number> index, <String> id, <Array> cellValues)

loadData

void loadData(<XMLDocument> doc, <Function> callback, <Boolean> keepExisting, <Number> insertIndex)

removeRow

void removeRow(<Number> index)

setNamedValue

void setNamedValue(node, name, value)

setValueAt

void setValueAt(<Object> value, <Number> rowIndex, <Number> colIndex)


Documentation generated by JSDoc on Sat Oct 14 06:07:10 2006