GSTable Class
A table-view with one or multiple columns. The user can add/remove items using a context menu or double-clicking the last row(if configured).
Item Index
Properties
- addItem
- addItem:withData:
- addItemAtSelectedIndex:withData:
- addItemUsingDialog
- BindingSignal.[attributeName]
- BindingSignal.items
- BindingSignal.selectedItem
- BindingSlot.[attributeName]
- columns
- columns[column].content
- columns[column].hidden
- columns[column].icon
- columns[column].text
- columns[column].width
- contextMenu
- copyItem:
- cutItem:
- dataSource
- dataType
- deleteItem:
- dialog
- editItemUsingDialog
- emptyItem
- emptyItemText
- headerView
- pasteItem:
- removeSelectedItem
- sortFormula
Properties
addItem
Delegate
Adds a new item by using the default values of the table-columns.
addItem:withData:
Delegate
Adds a new item by using the specified data. The data describes the item itself.
addItemAtSelectedIndex:withData:
Delegate
Adds a new item after the current selected item by using the specified data. The data describes the item itself.
addItemUsingDialog
Delegate
Adds a new item by using the associated dialog-popup.
BindingSignal.[attributeName]
Object
All attributes of the current selected item.
BindingSignal.items
Object
All items.
BindingSignal.selectedItem
Object
The current selected item.
BindingSlot.[attributeName]
Object
Any attribute of the current selected item can be set.
columns
Object
An array of columns for the table.
columns[column].content
Object | String
The columns content. It can be just a formula or a key-value map. The formula has
one parameter "d" which is the current table-item.
The key-value map has the format { key: "aKey", values: { key1: value, key2: value, ... } }.
The "key" is a attribute-name of the current table-item. The value of that attribute is used
as a key for the values to get and display the value. For Example:
Column Content-Property: { key: "favoriteFruit", values: { "apple": "Apple", "banana": "Banana" } }
Item Data: { favoriteFruit: "apple" }
That example would return "Apple" for the example item data.
columns[column].icon
String
Name of the icon used for the column.
columns[column].text
String
Header text of the column if table-header is visible.
columns[column].width
Number
The column's width in pixels.
contextMenu
ContextMenu
The context-menu for the table. Can be used to provide actions like copy, paste, delete, etc.
copyItem:
Delegate
Copys the selected item.
cutItem:
Delegate
Cuts the selected item.
dataSource
DataSourceDescriptor
The table's data source. That is only for table which are read-only and cannot be modified by the user. The data source can be a data-record collection or a predefined array of values. See DataSourceDescriptor for more info.
dataType
String
A mime-type describing the type of data in the table. If not present, the type is novelsharp/
deleteItem:
Delegate
Deletes the selected item.
dialog
DialogDescriptor
The dialog used to add/edit items. If not present no items can be add/edit by the user.
editItemUsingDialog
Delegate
Edits the selected item using the associated dialog-popup.
emptyItem
Boolean
Indicates if the table uses an extra row to allow the user adding new items through double-click on that row. The text of that row can be controlled using emptyItemText attribute.
emptyItemText
String
The text for the extra row if emptyItem is set.
headerView
Boolean
Indicates if the table-header is visible.
pasteItem:
Delegate
Paste an item from clipboard.
removeSelectedItem
Delegate
Removes the selected item.
sortFormula
String
A formula used to sort the items of the tabel. It takes two parameters "a" and "b" which are both table-items.