<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Wt: Wt::Ext::DataStore Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Wt  <span id="projectnumber">3.2.3</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceWt.html">Wt</a> </li> <li class="navelem"><a class="el" href="namespaceWt_1_1Ext.html">Ext</a> </li> <li class="navelem"><a class="el" href="classWt_1_1Ext_1_1DataStore.html">DataStore</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> </div> <div class="headertitle"> <div class="title">Wt::Ext::DataStore Class Reference<div class="ingroups"><a class="el" href="group__ext.html">Ext widgets (Wt::Ext, deprecated)</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="Wt::Ext::DataStore" --><!-- doxytag: inherits="Wt::WResource" --> <p>A resource that serializes data from a data model. <a href="classWt_1_1Ext_1_1DataStore.html#details">More...</a></p> <p><code>#include <Wt/Ext/DataStore></code></p> <div class="dynheader"> Inheritance diagram for Wt::Ext::DataStore:</div> <div class="dyncontent"> <div class="center"><img src="classWt_1_1Ext_1_1DataStore__inherit__graph.png" border="0" usemap="#Wt_1_1Ext_1_1DataStore_inherit__map" alt="Inheritance graph"/></div> <map name="Wt_1_1Ext_1_1DataStore_inherit__map" id="Wt_1_1Ext_1_1DataStore_inherit__map"> <area shape="rect" href="classWt_1_1WResource.html" title="An object which can be rendered in the HTTP protocol." alt="" coords="13,80,128,107"/><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="23,5,119,32"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classWt_1_1Ext_1_1DataStore-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1DataStore.html#a9d88086e22ca1f48b8378494fe9222f9">DataStore</a> (<a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *model, <a class="el" href="group__ext.html#ga5bc908c6e6aa90646cca1276d68cb2b2">DataLocation</a> dataLocation, <a class="el" href="classWt_1_1WObject.html">WObject</a> *parent=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new data store. <a href="#a9d88086e22ca1f48b8378494fe9222f9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4b2c3c030c6557aa6e3beadb50bf1643"></a><!-- doxytag: member="Wt::Ext::DataStore::~DataStore" ref="a4b2c3c030c6557aa6e3beadb50bf1643" args="()" -->  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1DataStore.html#a4b2c3c030c6557aa6e3beadb50bf1643">~DataStore</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1DataStore.html#a6fbd9be0f07bc864bc2921769d64a51e">addColumn</a> (int columnIndex, const std::string &jsonName)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Add a column to the list of columns to be serialized. <a href="#a6fbd9be0f07bc864bc2921769d64a51e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1DataStore.html#ad4e923221657f57281d76c02b3a4d803">setFilterColumn</a> (int columnIndex)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the column which is used to handle filter requests. <a href="#ad4e923221657f57281d76c02b3a4d803"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Ext_1_1DataStore.html#a95828fc3362ef58ff821790180bf9834">handleRequest</a> (const <a class="el" href="classWt_1_1Http_1_1Request.html">Http::Request</a> &request, <a class="el" href="classWt_1_1Http_1_1Response.html">Http::Response</a> &response)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Handles a request. <a href="#a95828fc3362ef58ff821790180bf9834"></a><br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>A resource that serializes data from a data model. </p> <p>An instance of this class is used by <a class="el" href="classWt_1_1Ext_1_1ComboBox.html" title="A widget that provides a drop-down combo-box control.">ComboBox</a> and <a class="el" href="classWt_1_1Ext_1_1TableView.html" title="A widget that displays data in a table.">TableView</a> widgets to serialize data from a <a class="el" href="classWt_1_1WAbstractItemModel.html" title="An abstract model for use with Wt's view classes.">WAbstractItemModel</a>. 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.</p> <p>To use the data store, you need to specify which columns from the model need to be serialized. </p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a9d88086e22ca1f48b8378494fe9222f9"></a><!-- doxytag: member="Wt::Ext::DataStore::DataStore" ref="a9d88086e22ca1f48b8378494fe9222f9" args="(WAbstractItemModel *model, DataLocation dataLocation, WObject *parent=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Wt::Ext::DataStore::DataStore </td> <td>(</td> <td class="paramtype"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> * </td> <td class="paramname"><em>model</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__ext.html#ga5bc908c6e6aa90646cca1276d68cb2b2">DataLocation</a> </td> <td class="paramname"><em>dataLocation</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classWt_1_1WObject.html">WObject</a> * </td> <td class="paramname"><em>parent</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Create a new data store. </p> <p>Data will be fecthed from <em>model</em>. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a6fbd9be0f07bc864bc2921769d64a51e"></a><!-- doxytag: member="Wt::Ext::DataStore::addColumn" ref="a6fbd9be0f07bc864bc2921769d64a51e" args="(int columnIndex, const std::string &jsonName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Ext::DataStore::addColumn </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>columnIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>jsonName</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Add a column to the list of columns to be serialized. </p> <p>The column <em>columnIndex</em> of the model is added to the current list of columns that are serialized. The <em>jsonName</em> provides the column label that is transmitted. </p> </div> </div> <a class="anchor" id="a95828fc3362ef58ff821790180bf9834"></a><!-- doxytag: member="Wt::Ext::DataStore::handleRequest" ref="a95828fc3362ef58ff821790180bf9834" args="(const Http::Request &request, Http::Response &response)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Ext::DataStore::handleRequest </td> <td>(</td> <td class="paramtype">const <a class="el" href="classWt_1_1Http_1_1Request.html">Http::Request</a> & </td> <td class="paramname"><em>request</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classWt_1_1Http_1_1Response.html">Http::Response</a> & </td> <td class="paramname"><em>response</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Handles a request. </p> <p>Reimplement this method so that a proper response is generated for the given request. From the <code>request</code> object you can access request parameters and whether the request is a continuation request. In the <code>response</code> object, you should set the mime type and stream the output data.</p> <p>A request may also concern a continuation, indicated in <a class="el" href="classWt_1_1Http_1_1Request.html#a2d4f88961a222be846460a8238823ae0" title="Returns a continuation object.">Http::Request::continuation()</a>, in which case the next part for a previously created continuation should be served.</p> <p>While handling a request, which may happen at any time together with event handling, the library makes sure that the resource is not being concurrently deleted, but multiple requests may happend simultaneously for a single resource. </p> <p>Implements <a class="el" href="classWt_1_1WResource.html#a3a740f8cc29e2e6e4e58defc9c88b8b6">Wt::WResource</a>.</p> </div> </div> <a class="anchor" id="ad4e923221657f57281d76c02b3a4d803"></a><!-- doxytag: member="Wt::Ext::DataStore::setFilterColumn" ref="ad4e923221657f57281d76c02b3a4d803" args="(int columnIndex)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Wt::Ext::DataStore::setFilterColumn </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>columnIndex</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Set the column which is used to handle filter requests. </p> <p>A request for filtering data will be done by matching the given filter against data in the model at column <em>columnIndex</em>. </p> </div> </div> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr size="1"><address style="text-align: right; margin: 3px"><small> Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the C++ Web Toolkit (Wt)</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" border="0" style="vertical-align: middle; display: inline-block; height: 2em"></a> 1.7.5.1</small></address> </body> </html>