Optionalcalcdetermine the display value for this attribute. This is used for display if customRenderer is not specified. It's also used for sorting the table so unless isSortable is false and a customRenderer is used you have to provide a calc function. Please return "appropriate" types, that is: standard types like string, boolean, number, Date and from those the one that most closely models what the data contains (i.e. if the attribute is a date return a Date object so that the Table can properly render and sort it according to the locale) \note: calc may return a Promise, the table will then update once the value is calculated \note: The table will only automatically refresh and call "calc" if one of its props changes. This means that if you bind a variable to your calc function which is not part of the Table props the Table may appear glitchy as it won't update as necessary.
Optionalconditionif specified, this is called to determine if the attribute is visible at all. This can be used to hide attributes on game where they aren't supported. This will only be evaluated when the table is created, when the user switches column visibility manually or when the list of table columns programmatically changes but you can not use it to dynamically hide columns without changing any table props.
Optionalcssallows the attribute to add a css class to the table row.
Optionalcustomif specified this function is used to render the value in the table instead of the usual cell renderer. Please note that if you want caching or asynchronous calculation for this cell you'll have to implement it yourself. Also note that table cells using customRenderer will do more unnecessary rerenders than a calc-based field so please use customRenderer only when necessary.
Optionaldescriptionlengthier description of what the attribute represents (currently unused but please provide one anyway)
describes how editing for this field should work. Only one out of "choices", "validate" should be used
Please note that this only works if no customRenderer is set. Otherwise that renderer will have to implement its own editing functionality
Optionalactions?: booleanAffects how choices are displayed if you have a choice attribute if true (or undefined) then we display a drop-down box where each item immediately triggers an action. If false, render a selection box
Optionalchoices?: (object: T) => IEditChoice[]if set, this field is a drop-down selection with the choices returned by this function. Please note: the value returned by calc has to appear in the text-field of one of these choices
Optionalinline?: booleanallow inline editing of this cell for attribute with "choices".
Optionalmax?: numbermaximum value, infinity by default
Optionalmin?: numberminimum value, minus infinity by default
OptionalonChangeValue?: (objects: T | T[], newValue: any) => voidcalled when this attribute was changed for an object. The way editing is presented to the user (if you didn't specify a customRenderer) depends on the value type. Potentially "newValue" can be undefined which signals a "toggle" or "cycle to the next value"
If this attribute is undefined, the field is readonly
Optionalplaceholder?: () => stringif set, this is called to determine the placeholder to be displayed when the input box is empty. Has no effect if this edit config doesn't generate an input box
OptionalreadOnly?: (object: any) => booleanif set, this function determines if the attribute is editable. If "edit" is an empty object, the attribute is readonly. If "edit" is non-empty and "readonly" is undefined, the attribute is editable.
@note: This currently only affects controls in the sidebar, not the ones in the table
Optionalvalidate?: (input: string) => ValidationStateif set, this field is a text field that validates its input
Optionalexternalwhen using external data (not part of the data passed to the table) in calc or customRenderer, set this parameter. This function gets called with a callback that then needs to be called whenever the external data (any of it) changes to cause a rerender.
Optionalfilterif set, the table can be filtered by this attribute using the specified control
Optionalgroupif set, the group name is going to be translated using this function before being displayed to the user (this affects only the group headers, not filters) You probably want to use this if you have a customRenderer on a column that is groupable
Optionalhelpoptional help text regarding this field. This will only show up in the details pane, if there is no custom renderer and only if a name is set (as otherwise the space for the help icon doesn't exist)
Optionaliconicon for the attribute. This is currently only used for the toggle button if the column is toggleable
internal id of the attribute
Optionalisif set, this attribute will be the one that gets focused when pressing ctrl+f There can only be one of these and it should be a column that is visible by default. And of course it has to be filterable If more than one attribute has this flag the first one will be used.
Optionalisif this is true and if the user hasn't changed column sorting yet, this column will be used for sorting (ascending) as long as it's visible and no previous column had this flag set.
Optionalisif true (default), the column is visible by default otherwise the user has to activate it manually first
Optionalisif true, the rendered control will be extensible with wrappers (see registerControlWrapper),
with a name that is generated from
Optionalisif true (or a function), the table can be grouped by this attribute. if this is a function it will be called with the object to determine the value to use for grouping, otherwise the output of calc is used. This function must be fast, unlike calc the result from this is not cached (at this time)
Optionalisif true, the table can be sorted by this attribute
Optionalisif true the attribute can be disabled in the table
OptionalisTODO: Obsolete if true, the calc-function for this attribute is called whenever table data is refreshed, even if the corresponding row data didn't change. Otherwise (default) the values for this attribute are only updated when the input data to the row changes. This means you need this flag, if the value of the attribute may change without the row data changing. This is the case for example when your extension generates data in a separate object and then only uses the row id to look up data from that object. If you fail to set this flag when the rendered data isn't part of the table data your attribute won't show up at all You should make extra sure the calc-function is quick though. If it takes computation, you may want to use a custom renderer with some manner of caching and debouncing.
Optionalnameuser readable name for the attribute (appears in the header and potentially in tooltips)
OptionalnoNever shrink the column while scrolling, it can still grow though
specifies whether the attribute appears in the table, the details pane or both. \note that "isToggleable" and "isSortable" have no effect on attributes that don't appear in the table
OptionalpositionIf set, determins the order in which attributes are displayed (the order of columns if placement is 'table' or vertical order in details). Lower number means further left/further up respectively. In the futuer users may be able to customize the column order at which point this should be considered a default. All attributes where this isn't set will default to 100 and be ordered according to how attributes appear in code
Optionalsortcustom function for sorting by this attribute. The parameters passed in (lhs and rhs) are the output of calc (cached). Return <0 if lhs is smaller than rhs, >0 if it's bigger and =0 if they are equal.
Optionalsortcustom function for sorting by this attribute. The parameters passed in (lhs and rhs) are the objects to compare. Return <0 if lhs is smaller than rhs, >0 if it's bigger and =0 if they are equal.
Optionalsupportsdoes this attribute support displaying and editing multiple values? defaults to false. If this is false the attribute is not displayed with multiple items selected. If this is true, customRenderer receives an array of objects to display and onChangeValue receive an array of rows to set the new value on
declaration of an attribute of a table
Export
IModAttribute