Hi,
In the current Backgrid implementation, the cell can be made editable
through "editable: true/false" settings. It takes only boolean value.
So, added support for the function, that can be set as an editable option
value.
*For Example:*
editable: function(m) { return false; }
Please find attached patch for the same.
Thanks,
Khushboo
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index ae807cb..909d014 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -1078,7 +1078,6 @@
});
self.model.set(data.name, collection, {silent: true});
}
-
// Initialize a new Grid instance
var grid = self.grid = new Backgrid.Grid({
columns: gridSchema.columns,
@@ -1454,7 +1453,8 @@
// This can be disabled in some cases (if not hidden)
disabled: (disabled ? true : evalASFunc(s.disabled)),
- editable: (disabled ? false : (_.isUndefined(s.editable) ? pgAdmin.editableCell : !!(s.editable))),
+ editable: _.isUndefined(s.editable) ?
+ pgAdmin.editableCell : evalASFunc(s.editable),
subnode: ((_.isString(s.model) && s.model in pgBrowser.Nodes) ?
pgBrowser.Nodes[s.model].model : s.model),
canAdd: (disabled ? false : evalASFunc(s.canAdd)),
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers