PFA control for displaying auto vacuum fields into grid. This control is common for
Materialized View Node and Table Node.
{
id: 'vacuum_table', label: '{{ _("Vacuum Table") }}',
model: VacuumTableModel, editable: false, type: 'collection',
canEdit: true, group: '{{ _("Table") }}',
mode: ['edit', 'create'], url: 'get_vacuum_defaults',
control: Backform.VacuumCollectionControl.extend({
grid_columns :[
{
name: 'label', label: '{{ _("Label") }}',
cell: 'string', editable: false
},
{
name: 'value', label: '{{ _("Value") }}',
cellFunction: cellFunction, editable: function(m) {
if(m.handler.has('autovacuum_enabled')) {
return m.handler.get('autovacuum_enabled');
}
return !m.handler.isNew();
}
},
{
name: 'setting', label: '{{ _("Default value") }}',
cellFunction: cellFunction, editable: false
}
]
}),
Please review the patch.