mirror of
https://github.com/Insality/druid
synced 2025-06-27 18:37:45 +02:00
507 lines
11 KiB
HTML
507 lines
11 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<head>
|
|
<title>Defold Druid UI Library</title>
|
|
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
|
|
</head>
|
|
<body>
|
|
|
|
<div id="container">
|
|
|
|
<div id="product">
|
|
<div id="product_logo"></div>
|
|
<div id="product_name"><big><b></b></big></div>
|
|
<div id="product_description"></div>
|
|
</div> <!-- id="product" -->
|
|
|
|
|
|
<div id="main">
|
|
|
|
|
|
<!-- Menu -->
|
|
|
|
<div id="navigation">
|
|
<br/>
|
|
<h1>Druid</h1>
|
|
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
</ul>
|
|
|
|
<h2>Contents</h2>
|
|
<ul>
|
|
<li><a href="#Functions">Functions</a></li>
|
|
<li><a href="#Fields">Fields</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Modules</h2>
|
|
<ul class="nowrap">
|
|
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
|
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
|
<li><a href="../modules/Button.html">Button</a></li>
|
|
<li><a href="../modules/Drag.html">Drag</a></li>
|
|
<li><a href="../modules/Hover.html">Hover</a></li>
|
|
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
|
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
|
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
|
<li><a href="../modules/Text.html">Text</a></li>
|
|
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
|
<li><a href="../modules/druid.html">druid</a></li>
|
|
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
|
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
|
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
|
<li><strong>DataList</strong></li>
|
|
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
|
<li><a href="../modules/Input.html">Input</a></li>
|
|
<li><a href="../modules/LangText.html">LangText</a></li>
|
|
<li><a href="../modules/Progress.html">Progress</a></li>
|
|
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
|
<li><a href="../modules/Slider.html">Slider</a></li>
|
|
<li><a href="../modules/Timer.html">Timer</a></li>
|
|
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
|
|
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>DataList</code></h1>
|
|
<p>Component to manage data for huge dataset in scroll.</p>
|
|
<p>
|
|
It requires Druid Scroll and Druid Grid (Static or Dynamic) components</p>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#init">init(self, scroll, grid, create_function)</a></td>
|
|
<td class="summary">Data list constructor</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#on_remove">on_remove(self)</a></td>
|
|
<td class="summary">Druid System on_remove function</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#set_data">set_data(self, data)</a></td>
|
|
<td class="summary">Set new data set for DataList component</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
|
|
<td class="summary">Clear the DataList and refresh visuals</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_first_index">get_first_index(self)</a></td>
|
|
<td class="summary">Return first index from data.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_last_index">get_last_index(self)</a></td>
|
|
<td class="summary">Return last index from data</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_length">get_length(self)</a></td>
|
|
<td class="summary">Return amount of data</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_index">get_index(self, data)</a></td>
|
|
<td class="summary">Return index for data value</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#scroll_to_index">scroll_to_index(self, index)</a></td>
|
|
<td class="summary">Instant scroll to element with passed index</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Fields">Fields</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#scroll">scroll</a></td>
|
|
<td class="summary">The Druid scroll component</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#grid">grid</a></td>
|
|
<td class="summary">The Druid Grid component</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#top_index">top_index</a></td>
|
|
<td class="summary">The current visual top data index</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#last_index">last_index</a></td>
|
|
<td class="summary">The current visual last data index</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#scroll_progress">scroll_progress</a></td>
|
|
<td class="summary">The current progress of scroll posititon</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#on_scroll_progress_change">on_scroll_progress_change</a></td>
|
|
<td class="summary">Event triggered when scroll progress is changed; event(self, progress_value)</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "init"></a>
|
|
<strong>init(self, scroll, grid, create_function)</strong>
|
|
</dt>
|
|
<dd>
|
|
Data list constructor
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
<li><span class="parameter">scroll</span>
|
|
<span class="types"><span class="type">druid.scroll</span></span>
|
|
The Scroll instance for Data List component
|
|
</li>
|
|
<li><span class="parameter">grid</span>
|
|
<span class="types"><span class="type">druid.grid</span></span>
|
|
The Grid instance for Data List component
|
|
</li>
|
|
<li><span class="parameter">create_function</span>
|
|
<span class="types"><span class="type">function</span></span>
|
|
The create function callback(self, data, index, data_list). Function should return (node, [component])
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "on_remove"></a>
|
|
<strong>on_remove(self)</strong>
|
|
</dt>
|
|
<dd>
|
|
Druid System on_remove function
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "set_data"></a>
|
|
<strong>set_data(self, data)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set new data set for DataList component
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
<li><span class="parameter">data</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
The new data array
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">druid.data_list</span></span>
|
|
Current DataList instance
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "clear"></a>
|
|
<strong>clear(self)</strong>
|
|
</dt>
|
|
<dd>
|
|
Clear the DataList and refresh visuals
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_first_index"></a>
|
|
<strong>get_first_index(self)</strong>
|
|
</dt>
|
|
<dd>
|
|
Return first index from data. It not always equals to 1
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_last_index"></a>
|
|
<strong>get_last_index(self)</strong>
|
|
</dt>
|
|
<dd>
|
|
Return last index from data
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_length"></a>
|
|
<strong>get_length(self)</strong>
|
|
</dt>
|
|
<dd>
|
|
Return amount of data
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_index"></a>
|
|
<strong>get_index(self, data)</strong>
|
|
</dt>
|
|
<dd>
|
|
Return index for data value
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
<li><span class="parameter">data</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "scroll_to_index"></a>
|
|
<strong>scroll_to_index(self, index)</strong>
|
|
</dt>
|
|
<dd>
|
|
Instant scroll to element with passed index
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">DataList</span></span>
|
|
|
|
</li>
|
|
<li><span class="parameter">index</span>
|
|
<span class="types"><span class="type">number</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "scroll"></a>
|
|
<strong>scroll</strong>
|
|
</dt>
|
|
<dd>
|
|
The Druid scroll component
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">scroll</span>
|
|
<span class="types"><span class="type">druid.scroll</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "grid"></a>
|
|
<strong>grid</strong>
|
|
</dt>
|
|
<dd>
|
|
The Druid Grid component
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">grid</span>
|
|
<span class="types"><span class="type">druid.static_grid</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "top_index"></a>
|
|
<strong>top_index</strong>
|
|
</dt>
|
|
<dd>
|
|
The current visual top data index
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">top_index</span>
|
|
<span class="types"><span class="type">number</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "last_index"></a>
|
|
<strong>last_index</strong>
|
|
</dt>
|
|
<dd>
|
|
The current visual last data index
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">last_index</span>
|
|
<span class="types"><span class="type">number</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "scroll_progress"></a>
|
|
<strong>scroll_progress</strong>
|
|
</dt>
|
|
<dd>
|
|
The current progress of scroll posititon
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">scroll_progress</span>
|
|
<span class="types"><span class="type">number</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "on_scroll_progress_change"></a>
|
|
<strong>on_scroll_progress_change</strong>
|
|
</dt>
|
|
<dd>
|
|
Event triggered when scroll progress is changed; event(self, progress_value)
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">on_scroll_progress_change</span>
|
|
<span class="types"><span class="type">druid_event</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
</div> <!-- id="main" -->
|
|
<div id="about">
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
|
<i style="float:right;">Last updated 2021-10-23 17:32:40 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|