From e4db4d76339ee7d39d9450dadc6e41735d61194b Mon Sep 17 00:00:00 2001 From: Owen Stephens Date: Fri, 27 Oct 2017 10:53:27 +0100 Subject: [PATCH] Catch error from server when invalid Regular Expression used in Text Filter --- main/webapp/modules/core/scripts/project.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main/webapp/modules/core/scripts/project.js b/main/webapp/modules/core/scripts/project.js index 65d99904e..c67fc6e17 100644 --- a/main/webapp/modules/core/scripts/project.js +++ b/main/webapp/modules/core/scripts/project.js @@ -425,9 +425,15 @@ Refine.fetchRows = function(start, limit, onDone, sorting) { } $.post( - "command/core/get-rows?" + $.param({ project: theProject.id, start: start, limit: limit }) + "&callback=?", + "command/core/get-rows?" + $.param({ project: theProject.id, start: start, limit: limit }), body, function(data) { + if(data.code === 'error') { + data = theProject.rowModel; + //maybe change the data to zero? + data.rows = []; + data.filtered = 0; + } theProject.rowModel = data; // Un-pool objects @@ -445,7 +451,7 @@ Refine.fetchRows = function(start, limit, onDone, sorting) { onDone(); } }, - "jsonp" + "json" ); };