Wt::Ext::DataStore Class Reference
[Ext widgets]

A resource that serializes data from a data model. More...

#include <Wt/Ext/DataStore>

Inheritance diagram for Wt::Ext::DataStore:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 DataStore (WAbstractItemModel *model, DataLocation dataLocation, WObject *parent=0)
 Create a new data store.
void addColumn (int columnIndex, const std::string &jsonName)
 Add a column to the list of columns to be serialized.
void setFilterColumn (int columnIndex)
 Set the column which is used to handle filter requests.

Protected Member Functions

virtual const std::string resourceMimeType () const
 Return the mimetype.


Detailed Description

A resource that serializes data from a data model.

An instance of this class is used by ComboBox and TableView widgets to serialize data from a WAbstractItemModel. The data store can serialize data both for a ClientSide or ServerSide location of the data. When the location is ServerSide, the model supports transmission of certain data pages, and filtering of the model.

To use the data store, you need to specify which columns from the model need to be serialized.


Constructor & Destructor Documentation

Wt::Ext::DataStore::DataStore ( WAbstractItemModel model,
DataLocation  dataLocation,
WObject parent = 0 
)

Create a new data store.

Data will be fecthed from model.


Member Function Documentation

void Wt::Ext::DataStore::addColumn ( int  columnIndex,
const std::string &  jsonName 
)

Add a column to the list of columns to be serialized.

The column columnIndex of the model is added to the current list of columns that are serialized. The jsonName provides the column label that is transmitted.

void Wt::Ext::DataStore::setFilterColumn ( int  columnIndex  ) 

Set the column which is used to handle filter requests.

A request for filtering data will be done by matching the given filter against data in the model at column columnIndex.

const std::string Wt::Ext::DataStore::resourceMimeType (  )  const [protected, virtual]

Return the mimetype.

Implement this method to return the correct mime type for your resource, e.g. "text/html".

Implements Wt::WResource.


Generated on Fri Sep 12 17:01:15 2008 for Wt by doxygen 1.5.6