Alien-GvaScript
view release on metacpan or search on metacpan
doc/html/Grid.html view on Meta::CPAN
</div>
</div>
</div>
<div class="TN_node" id="METHODS">
<h2 class="TN_label">METHODS</h2>
<div class="TN_content">
<div class="TN_node" id="clearResult">
<h3 class="TN_label">clearResult</h3>
<div class="TN_content">
<pre> grid.clearResult(msg)</pre>
<p>This method clears the grid result container and displays <code>msg</code> instead.</p>
</div>
</div>
<div class="TN_node" id="clearToolbar">
<h3 class="TN_label">clearToolbar</h3>
<div class="TN_content">
<pre> grid.clearToolbar()</pre>
<p>This methods clears the grid toolbar container.</p>
</div>
</div>
<div class="TN_node" id="clearActionButtons">
<h3 class="TN_label">clearActionButtons</h3>
<div class="TN_content">
<pre> grid.clearActionButtons()</pre>
<p>This method clears the action buttons container and thus removes the buttons</p>
</div>
</div>
<div class="TN_node" id="clear">
<h3 class="TN_label">clear</h3>
<div class="TN_content">
<pre> grid.clear(msg)</pre>
<p>This method is equivalent to <code>grid.clearResult(msg)</code> and <code>grid.clearToolbar()</code></p>
</div>
</div>
<div class="TN_node" id="addActionButtons">
<h3 class="TN_label">addActionButtons</h3>
<div class="TN_content">
<pre> grid.addActionButtons()</pre>
<p>This method renders the action buttons based on the grids actions.
NOTE that the actions conditions will be re-evaluated.</p>
</div>
</div>
<div class="TN_node" id="destroy">
<h3 class="TN_label">destroy</h3>
<div class="TN_content">
<pre> my_grid.destroy();</pre>
<p>This method will unregister the Grid in the GvaScript.Grids namespace and
will iteratively call the destructor on all the grid's depedencies
this removing all handlers attached.
Call this method when the grid is removed
from the DOM.</p>
</div>
</div>
</div>
</div>
<div class="TN_node" id="EVENTS">
<h2 class="TN_label">EVENTS</h2>
<div class="TN_content">
<div class="TN_node" id="onShow">
<h3 class="TN_label">onShow</h3>
<div class="TN_content">
<p>This event is triggered of the table is rendered and displayed.
Useful for attaching custom events on table records/cells.</p>
</div>
</div>
<div class="TN_node" id="onHighlight">
<h3 class="TN_label">onHighlight</h3>
<div class="TN_content">
<p>This event is triggered when a choice in the list is highlighted.
The event handler may use <code>event.index</code> to know the index of the
highlighted choice.</p>
</div>
</div>
<div class="TN_node" id="onPing">
<h3 class="TN_label">onPing</h3>
<div class="TN_content">
<p>This event is triggered when a choice in the list is "ping-ed", i.e.
either by dblclicking, clicking on selected row or by pressing the <code>RETURN</code> key.
The event handler will recieve 1 arguement <code>target</code> which is the record object that has been "Pinged".</p>
<p>Ex: <code>{'fname': 'Mary', 'lname': 'Major', 'gender': 'f'}</code></p>
</div>
</div>
<div class="TN_node" id="onCancel">
<h3 class="TN_label">onCancel</h3>
<div class="TN_content">
<p>This event is triggered when the user presses the <code>ESCAPE</code> key.</p>
</div>
</div>
<div class="TN_node" id="onEmpty">
<h3 class="TN_label">onEmpty</h3>
<div class="TN_content">
<p>This event is triggered when the list is empty.</p>
</div>
</div>
</div>
</div>
<div class="TN_node" id="EXAMPLE">
<h2 class="TN_label">EXAMPLE</h2>
<div class="TN_content">
<div class="TN_node" id="JAVASCRIPT">
<h3 class="TN_label">JAVASCRIPT</h3>
<div class="TN_content">
<pre> var my_url = "/app/path/to/data/list";
var my_grid = new GvaScript.Grid("ex_grid", my_url, {
grid_container: 'ex_grid_list',
toolbar_container: 'ex_grid_toolbar',
dto: {VUE: 'JSON'},
pagesize: 3,
columns: [
{label: 'Full Name', value: function(e) {
return e.fname + ' ' + e.lname;
}},
{label: 'Gender', value: 'gender', css: 'tcenter', default_value: 'unknown'}
],
actions: [
{
label: 'Add',
( run in 0.499 second using v1.01-cache-2.11-cpan-524268b4103 )