add RecordsTable field - context-based, i.e. the columns are defined in the object or type
This commit is contained in:
parent
e5f1be9f91
commit
94ce64ef00
2 changed files with 17 additions and 0 deletions
|
@ -282,6 +282,13 @@ class KeyTableFieldInstance(RecordsFieldInstance):
|
|||
pass
|
||||
|
||||
|
||||
class ContextBasedRecordsFieldInstance(RecordsFieldInstance):
|
||||
|
||||
@Lazy
|
||||
def columnTypes(self):
|
||||
obj = self.clientInstance.context
|
||||
return [Field(name) for name in obj.columnNames]
|
||||
|
||||
class ContextBasedKeyTableFieldInstance(KeyTableFieldInstance):
|
||||
|
||||
@Lazy
|
||||
|
|
|
@ -51,6 +51,16 @@ class Records(Grid):
|
|||
instanceName='records',))
|
||||
|
||||
|
||||
class RecordsTable(Grid):
|
||||
|
||||
__typeInfo__ = ('recordstable',
|
||||
FieldType('recordstable', 'recordstable',
|
||||
u'A series of records or rows.',
|
||||
displayRenderer='display_records',
|
||||
inputRenderer='input_records',
|
||||
instanceName='recordstable',))
|
||||
|
||||
|
||||
class KeyTable(Grid):
|
||||
|
||||
__typeInfo__ = ('keytable',
|
||||
|
|
Loading…
Add table
Reference in a new issue