Skip to content

Commit aac25fd

Browse files
committed
Minor style updates for rendering error messages in DBView
1 parent cba01c8 commit aac25fd

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

ui/javascript/widgets/DBView.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ javaxt.express.DBView = function(parent, config) {
123123
padding: "7px 0 7px 0px",
124124
backgroundColor: "",
125125
li: "tree-node"
126+
},
127+
128+
error: {
129+
fontFamily: '"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace',
130+
color: "#6c6c6c",
131+
padding: "10px"
126132
}
127133
},
128134

@@ -628,10 +634,31 @@ javaxt.express.DBView = function(parent, config) {
628634
var showError = function(msg){
629635
cancelButton.disable();
630636

631-
if (msg.responseText){
637+
//Update message
638+
if (msg && msg.responseText){
632639
msg = (msg.responseText.length>0 ? msg.responseText : msg.statusText);
633640
}
634-
gridContainer.innerHTML = msg;
641+
if (msg) msg = msg.replaceAll("\n","<br>");
642+
643+
644+
//Populate the bottom panel
645+
gridContainer.innerHTML = "";
646+
var outerDiv = createElement("div", gridContainer, {
647+
width: "100%",
648+
height: "100%",
649+
position: "relative",
650+
overflow: "auto"
651+
});
652+
var innerDiv = createElement("div", outerDiv, {
653+
width: "100%",
654+
height: "100%",
655+
position: "absolute"
656+
});
657+
var div = createElement("div", innerDiv, config.style.error);
658+
div.innerHTML = msg;
659+
660+
661+
//Hide waitmask
635662
if (waitmask) waitmask.hide();
636663
};
637664

@@ -776,7 +803,10 @@ javaxt.express.DBView = function(parent, config) {
776803
/** Used to render query results in a grid
777804
*/
778805
var render = function(records, columns){
779-
if (columns.length===0) return;
806+
if (!columns || columns.length===0){
807+
showError("No records");
808+
return;
809+
}
780810

781811
//mainMask.hide();
782812

0 commit comments

Comments
 (0)