forerunnerdb
Version:
A NoSQL document store database for browsers and Node.js.
1,864 lines (431 loc) • 23.3 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Grid</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Grid</h1>
<section>
<header>
<h2>Grid</h2>
<div class="class-description">Grid</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="Grid"><span class="type-signature"></span>new Grid<span class="signature">(selector, template, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Creates a new grid instance.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>selector</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last">jQuery selector.</td>
</tr>
<tr>
<td class="name"><code>template</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last">The template selector.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The options object to apply to the grid.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<ul><li><a href="#count"><span class="type-signature">(static) </span>count<span class="signature">()</span><span class="type-signature"> → {Number}</span></a></li><li><a href="#db"><span class="type-signature">(static) </span>db<span class="signature">(db<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#drop"><span class="type-signature">(static) </span>drop<span class="signature">()</span><span class="type-signature"> → {boolean}</span></a></li><li><a href="#from"><span class="type-signature">(static) </span>from<span class="signature">(dataSource)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></a></li><li><a href="#insert"><span class="type-signature">(static) </span>insert<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#name"><span class="type-signature">(static) </span>name<span class="signature">(val<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></a></li><li><a href="#refresh"><span class="type-signature">(static) </span>refresh<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#remove"><span class="type-signature">(static) </span>remove<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#state"><span class="type-signature">(static) </span>state<span class="signature">(val<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></a></li><li><a href="#template"><span class="type-signature">(static) </span>template<span class="signature">(template)</span><span class="type-signature"> → {*}</span></a></li><li><a href="#update"><span class="type-signature">(static) </span>update<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#updateById"><span class="type-signature">(static) </span>updateById<span class="signature">()</span><span class="type-signature"></span></a></li><li><a href="#query"><span class="type-signature"></span>query<span class="signature">(queryObj, queryOptions)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></a></li></ul>
<h4 class="name" id=".count"><span class="type-signature">(static) </span>count<span class="signature">()</span><span class="type-signature"> → {Number}</span></h4>
<div class="description">
Returns the number of documents currently in the grid.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line551">line 551</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".db"><span class="type-signature">(static) </span>db<span class="signature">(db<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
Gets / sets the db instance this class instance belongs to.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>db</code></td>
<td class="type">
<span class="param-type"><a href="Db.html">Db</a></span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The db instance.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line151">line 151</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id=".drop"><span class="type-signature">(static) </span>drop<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
Drops a grid and all it's stored data from the database.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line174">line 174</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True on success, false on failure.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id=".from"><span class="type-signature">(static) </span>from<span class="signature">(dataSource)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></h4>
<div class="description">
Sets the data source from which the grid will assemble its data.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>dataSource</code></td>
<td class="type">
<span class="param-type"><a href="View.html">View</a></span>
</td>
<td class="description last">The data source to use to assemble grid data.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line114">line 114</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Grid.html">Grid</a></span>
</dd>
</dl>
<h4 class="name" id=".insert"><span class="type-signature">(static) </span>insert<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Executes an insert against the grid's underlying data-source.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line78">line 78</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".name"><span class="type-signature">(static) </span>name<span class="signature">(val<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></h4>
<div class="description">
Gets / sets the current name.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>val</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The name to set.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line69">line 69</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Grid.html">Grid</a></span>
</dd>
</dl>
<h4 class="name" id=".refresh"><span class="type-signature">(static) </span>refresh<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Refreshes the grid data such as ordering etc.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line276">line 276</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".remove"><span class="type-signature">(static) </span>remove<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Executes a remove against the grid's underlying data-source.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line105">line 105</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".state"><span class="type-signature">(static) </span>state<span class="signature">(val<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></h4>
<div class="description">
Gets / sets the current state.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>val</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last">The name of the state to set.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line60">line 60</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Grid.html">Grid</a></span>
</dd>
</dl>
<h4 class="name" id=".template"><span class="type-signature">(static) </span>template<span class="signature">(template)</span><span class="type-signature"> → {*}</span></h4>
<div class="description">
Gets / sets the grid's HTML template to use when rendering.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>template</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The template's jQuery selector.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line219">line 219</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">*</span>
</dd>
</dl>
<h4 class="name" id=".update"><span class="type-signature">(static) </span>update<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Executes an update against the grid's underlying data-source.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line87">line 87</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".updateById"><span class="type-signature">(static) </span>updateById<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Executes an updateById against the grid's underlying data-source.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line96">line 96</a>
</li></ul></dd>
</dl>
<h4 class="name" id="query"><span class="type-signature"></span>query<span class="signature">(queryObj, queryOptions)</span><span class="type-signature"> → {<a href="Grid.html">Grid</a>}</span></h4>
<div class="description">
Sets the base query and query options on the grid that
will remain part of the query regardless of other changes.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>queryObj</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The query object.</td>
</tr>
<tr>
<td class="name"><code>queryOptions</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The query options object.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Grid.js.html">Grid.js</a>, <a href="Grid.js.html#line269">line 269</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Grid.html">Grid</a></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ActiveBucket.html">ActiveBucket</a></li><li><a href="Angular.html">Angular</a></li><li><a href="AutoBind.html">AutoBind</a></li><li><a href="Collection.html">Collection</a></li><li><a href="CollectionGroup.html">CollectionGroup</a></li><li><a href="Condition.html">Condition</a></li><li><a href="Core.html">Core</a></li><li><a href="Db.html">Db</a></li><li><a href="Document.html">Document</a></li><li><a href="Grid.html">Grid</a></li><li><a href="Highchart.html">Highchart</a></li><li><a href="Index2d.html">Index2d</a></li><li><a href="IndexBinaryTree.html">IndexBinaryTree</a></li><li><a href="IndexHashMap.html">IndexHashMap</a></li><li><a href="Infinilist.html">Infinilist</a></li><li><a href="KeyValueStore.html">KeyValueStore</a></li><li><a href="Metrics.html">Metrics</a></li><li><a href="MyModule.html">MyModule</a></li><li><a href="NodeApiClient.html">NodeApiClient</a></li><li><a href="NodeApiServer.html">NodeApiServer</a></li><li><a href="NodeRAS.html">NodeRAS</a></li><li><a href="Odm.html">Odm</a></li><li><a href="OldView.html">OldView</a></li><li><a href="Operation.html">Operation</a></li><li><a href="Overload.html">Overload</a></li><li><a href="Overview.html">Overview</a></li><li><a href="Overview_init.html">init</a></li><li><a href="Path.html">Path</a></li><li><a href="Persist.html">Persist</a></li><li><a href="Procedure.html">Procedure</a></li><li><a href="ReactorIO.html">ReactorIO</a></li><li><a href="Section.html">Section</a></li><li><a href="Serialiser.html">Serialiser</a></li><li><a href="Shared.overload.html">overload</a></li><li><a href="View.html">View</a></li></ul><h3>Mixins</h3><ul><li><a href="ChainReactor.html">ChainReactor</a></li><li><a href="Common.html">Common</a></li><li><a href="Constants.html">Constants</a></li><li><a href="Events.html">Events</a></li><li><a href="Matching.html">Matching</a></li><li><a href="Shared.html">Shared</a></li><li><a href="Sorting.html">Sorting</a></li><li><a href="Tags.html">Tags</a></li><li><a href="Triggers.html">Triggers</a></li><li><a href="Updating.html">Updating</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Mar 01 2018 11:34:23 GMT+0000 (GMT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>