From bae477477b7b272d2b8cb5842fc7f28d87f480f0 Mon Sep 17 00:00:00 2001 From: Manish Bisht Date: Thu, 15 Jun 2017 22:58:49 +0530 Subject: [PATCH] data shown in JSON format if the data-type is json Signed-off-by: Manish Bisht --- js/makegrid.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/makegrid.js b/js/makegrid.js index 61856f2670..2884882915 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -578,7 +578,8 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi var $cell = $(cell); if ('string' === $cell.attr('data-type') || - 'blob' === $cell.attr('data-type') + 'blob' === $cell.attr('data-type') || + 'json' === $cell.attr('data-type') ) { g.cEdit = g.cEditTextarea; } else { @@ -600,6 +601,9 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi }); // fill the cell edit with text from var value = PMA_getCellValue(cell); + if($cell.attr('data-type') == 'json'){ + value = JSON.stringify(JSON.parse(value), null, 4); + } $(g.cEdit).find('.edit_box').val(value); g.currentEditCell = cell;