Skip to content

Commit 1927b79

Browse files
DeanCordingknolleary
authored andcommitted
Add documentation for EditableList method addItems (#62)
* Added documentation for addItems method * Typo * Typos * Header and Height:auto features * Added section for node configuration properties * Merge with upstream * Revert "Added section for node configuration properties" This reverts commit 19aa946.
1 parent 7c1d87c commit 1927b79

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

docs/api/ui/editableList/index.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ own right. Used by the core `Switch` and `Change` nodes.
1515
<tr><td><a href="#options-addButton">addButton</a></td></tr>
1616
<tr><td><a href="#options-addItem">addItem</a></td></tr>
1717
<tr><td><a href="#options-connectWith">connectWith</a></td></tr>
18+
<tr><td><a href="#options-header">header</a></td></tr>
1819
<tr><td><a href="#options-height">height</a></td></tr>
1920
<tr><td><a href="#options-filter">filter</a></td></tr>
2021
<tr><td><a href="#options-resize">resize</a></td></tr>
@@ -31,6 +32,7 @@ own right. Used by the core `Switch` and `Change` nodes.
3132
<h3>Methods</h3>
3233
<table>
3334
<tr><td><a href="#methods-addItem">addItem</a></td></tr>
35+
<tr><td><a href="#methods-addItems">addItems</a></td></tr>
3436
<tr><td><a href="#methods-removeItem">removeItem</a></td></tr>
3537
<tr><td><a href="#methods-width">width</a></td></tr>
3638
<tr><td><a href="#methods-height">height</a></td></tr>
@@ -97,12 +99,21 @@ dragged from this list to any other jQuery `sortable` list, such as another `edi
9799
connectWith: ".my-other-list"
98100
});
99101

102+
#### <a href="#options-header" name="options-header">header</a>
103+
104+
<span class="method-return">Type: DOM/JQuery object</span>
105+
106+
Inserts the DOM/JQuery object as a header for the list.
107+
108+
$("ol.list").editableList({
109+
header: $("<div>").append($.parseHTML("<div style='width:40%; display: inline-grid'>Name</div><div style='display: inline-grid'>Type</div>")),
110+
});
100111

101112
#### <a href="#options-height" name="options-height">height</a>
102113

103114
<span class="method-return">Type: String|Number</span>
104115

105-
Sets the height of the list including, if enabled, its add button.
116+
Sets the height of the list including, if enabled, its add button. Setting height to 'auto' removes the vertical scrollbar and displays the list at the full height needed to contain the contents.
106117

107118
$("ol.list").editableList({
108119
height: 300
@@ -270,6 +281,14 @@ with the item in the list.
270281

271282
$("ol.list").editableList('addItem',{fruit:"banana"});
272283

284+
#### <a href="#methods-addItems" name="methods-addItems">addItems( itemData )</a>
285+
286+
Adds items contained in an array to the end of the list. `itemData` is an array of objects that will be associated
287+
with the item in the list.
288+
289+
$("ol.list").editableList('addItem',[{fruit:"banana"},{fruit:"apple"},{fruit:"pear"}]);
290+
291+
273292
#### <a href="#methods-removeItem" name="methods-removeItem">removeItem( itemData )</a>
274293

275294
Removes an item from the list. `itemData` is the object that identifies the item

0 commit comments

Comments
 (0)