mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Allow enabling/disabling of the Edit button of a sub-node collection grid.
This commit is contained in:
committed by
Dave Page
parent
d32e861a47
commit
3b03c17f2b
@@ -1098,11 +1098,13 @@
|
||||
if (data.disabled == false && data.canEdit) {
|
||||
var editCell = Backgrid.Extension.ObjectCell.extend({
|
||||
schema: gridSchema.schema
|
||||
});
|
||||
}),
|
||||
canEdit = self.field.has('canEdit') &&
|
||||
self.field.get('canEdit') || true;
|
||||
|
||||
gridSchema.columns.unshift({
|
||||
name: "pg-backform-edit", label: "", cell : editCell,
|
||||
cell_priority: -2
|
||||
cell_priority: -2, editable: canEdit
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1140,7 +1142,7 @@
|
||||
grid.insertRow({});
|
||||
var newRow = $(grid.body.rows[collection.length - 1].$el);
|
||||
newRow.attr("class", "new").click(function(e) {
|
||||
$(this).attr("class", "");
|
||||
$(this).attr("class", "editable");
|
||||
});
|
||||
$(newRow).pgMakeVisible('backform-tab');
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user