UNPKG

forerunnerdb

Version:

A NoSQL document store database for browsers and Node.js.

1,690 lines (386 loc) 18.6 kB
<!DOCTYPE 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"> &lt;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> <h4 class="name" id=".count"><span class="type-signature">(static) </span>count<span class="signature">()</span><span class="type-signature"> &rarr; {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#line479">line 479</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"> &rarr; {*}</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"> &lt;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#line142">line 142</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"> &rarr; {<a href="global.html#boolean">boolean</a>}</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#line165">line 165</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"><a href="global.html#boolean">boolean</a></span> </dd> </dl> <h4 class="name" id=".from"><span class="type-signature">(static) </span>from<span class="signature">(collection)</span><span class="type-signature"> &rarr; {<a href="Grid.html">Grid</a>}</span></h4> <div class="description"> Sets the collection 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>collection</code></td> <td class="type"> <span class="param-type"><a href="Collection.html">Collection</a></span> </td> <td class="description last">The collection 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#line112">line 112</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#line76">line 76</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"> &rarr; {<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"> &lt;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#line67">line 67</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#line247">line 247</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#line103">line 103</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"> &rarr; {<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"> &lt;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#line58">line 58</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"> &rarr; {*}</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">Selector</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#line207">line 207</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#line85">line 85</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#line94">line 94</a> </li></ul></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="BinaryTree.html">BinaryTree</a></li><li><a href="Collection.html">Collection</a></li><li><a href="CollectionGroup.html">CollectionGroup</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="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="OldView.html">OldView</a></li><li><a href="Operation.html">Operation</a></li><li><a href="Overload.html">Overload</a></li><li><a href="Path.html">Path</a></li><li><a href="Persist.html">Persist</a></li><li><a href="ReactorIO.html">ReactorIO</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="crcTable.html">crcTable</a></li><li><a href="Shared.html">Shared</a></li></ul><h3>Global</h3><ul><li><a href="global.html#%2522boolean,function%2522">"boolean, function"</a></li><li><a href="global.html#%2522string,*,function%2522">"string, *, function"</a></li><li><a href="global.html#%2522string,function%2522">"string, function"</a></li><li><a href="global.html#boolean">boolean</a></li><li><a href="global.html#function">function</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Thu Nov 19 2015 13:31:32 GMT+0000 (GMT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>