mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Format JSON/JSONB nicely when displaying it in the grid editor pop-up. Fixes #2748
This commit is contained in:
parent
5bfa450a5f
commit
362bd15c8e
@ -387,12 +387,12 @@
|
||||
this.loadValue = function (item) {
|
||||
var data = defaultValue = item[args.column.field];
|
||||
if (data && typeof data === "object" && !Array.isArray(data)) {
|
||||
data = JSON.stringify(data);
|
||||
data = JSON.stringify(data, null, 4);
|
||||
} else if (Array.isArray(data)) {
|
||||
var temp = [];
|
||||
$.each(data, function(i, val) {
|
||||
if (typeof val === "object") {
|
||||
temp.push(JSON.stringify(val));
|
||||
temp.push(JSON.stringify(val, null, 4));
|
||||
} else {
|
||||
temp.push(val)
|
||||
}
|
||||
@ -722,12 +722,12 @@
|
||||
this.loadValue = function (item) {
|
||||
var data = defaultValue = item[args.column.field];
|
||||
if (typeof data === "object" && !Array.isArray(data)) {
|
||||
data = JSON.stringify(data);
|
||||
data = JSON.stringify(data, null, 4);
|
||||
} else if (Array.isArray(data)) {
|
||||
var temp = [];
|
||||
$.each(data, function(i, val) {
|
||||
if (typeof val === "object") {
|
||||
temp.push(JSON.stringify(val));
|
||||
temp.push(JSON.stringify(val, null, 4));
|
||||
} else {
|
||||
temp.push(val)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user