Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Document dataSourceOptions, preserveDataSourceOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
interactivellama committed Apr 7, 2015
1 parent 4f2b604 commit dc6237e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion _includes/js/repeater.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ <h3 id="repeater-usage-options">Options</h3>
function. Run the callback function once you gather the appropriate information to complete
the rendering. Review more details on using <a href="#repeater-dataSource">dataSource</a> below.</td>
</tr>
<tr>
<td>dataSourceOptions</td>
<td>object</td>
<td>null</td>
<td>Use this object to pass a parameter to a custom-defined dataSource function mentioned above. Then, use those values to customize the data that gets passed back into the repeater from your API. Suggested uses include sorting, filtering, and search values. This object is also valuable in custom renders when used as an object within the <code>render</code> methods's <a href="#repeater-usage-methods-render">options parameter</a>. Did you lose your custom <code>dataSourceOptions</code> when you changed the page? If you did, set <code>preserveDataSourceOptions</code> to true in order to keep them.</td>
</tr>
<tr>
<td>defaultView</td>
<td>string or number</td>
Expand All @@ -277,6 +283,12 @@ <h3 id="repeater-usage-options">Options</h3>
<td>Specifies the number of items allowed within the <code>.repeater-primaryPaging</code> drop-down menu.
If the number of pages exceeds this amount, the code will use the <code>.repeater-secondaryPaging</code> input.</td>
</tr>
<tr>
<td>preserveDataSourceOptions</td>
<td>boolean</td>
<td>false</td>
<td>Sets whether defined<code>dataSourceOptions</code> get preserved or reset when the <code>dataSource</code> is called. For example, the <code>dataSource</code> function is called when navigating to another page. If you would like to keep previously defined settings such as search or filtering, then set to <code>true</code>. Setting to <code>true</code> is generally recommended when using <code>dataSourceOptions</code> to manipulate your data.</td>
</tr>
<tr>
<td>staticHeight</td>
<td>boolean or number</td>
Expand Down Expand Up @@ -443,7 +455,7 @@ <h3 id="repeater-usage-methods">Methods</h3>
<h3 id="repeater-dataSource">Data Source</h3>
<p>Call the <code>dataSource</code> function prior to rendering data for the current view. Receives an
<code>options</code> object and <code>callback</code> function as arguments. The <code>options</code> object
provides context for which data should return. Use the <code>callback</code> to continue onward
provides context for which data should return. Please review the <code>dataSourceOptions</code> option if the <code>datasource</code> needs to be manipulated (such as for a custom render, to search, to sort, or to filter). Use the <code>callback</code> to continue onward
with rendering.
</p>

Expand Down

0 comments on commit dc6237e

Please sign in to comment.