diff --git a/metadata/dbms/showrecord.js b/metadata/dbms/showrecord.js index 2a5c384..4d28882 100644 --- a/metadata/dbms/showrecord.js +++ b/metadata/dbms/showrecord.js @@ -424,6 +424,31 @@ class SRec //alert2(trt('Alert'),getXMLNodeSerialisation(this.nodeMetadata)); } + checkData(value,type,maybenull) + { + + if(value==undefined) return false; + if(type=="i4") + { + if((value=="")&&(maybenull==0)) return false; + return isInt(value) + }else + if(type=="f8" || type=="f4") + { + if((value=="")&&(maybenull==0)) return false; + return isFloat(value); + }else + if(type=="object") + { + if(((value=="-1")||(value==""))&&(maybenull==0)) return false; + }else + if((type=="string")||(type=="b")||(type=="dateTime")) + { + if((value=="")&&(maybenull==0)) return false; + } + return true; + }; + /** Function to send filter data to the server * id - id of record -1 then all * page - result page number @@ -445,6 +470,12 @@ class SRec { if(nextNode.nodeName=="column") { + if (!this.checkData(getCdataValue(nextNode),nextNode.getAttribute("vt"),nextNode.getAttribute("maybenull"))) + { + alert2(trt('Alert'),trt("The_field_data_is_incorrect")+" \""+nextNode.getAttribute("d")+"\"=\""+getCdataValue(nextNode)+"\"!"); + return; + } + if(nextNode.getAttribute("n")=="id" && id!=-1) { xs+=''; @@ -579,7 +610,8 @@ class SRec //td2.style.cssText='white-space:nowrap' td1.appendChild(document.createTextNode(columnNode.getAttribute("d"))); - td1.style.cssText='white-space:nowrap;'; + if(columnNode.getAttribute("maybenull")=='0') td1.style.cssText="white-space:nowrap;font-weight: bold;"; + else td1.style.cssText='white-space:nowrap;'; if (columnNode.getAttribute("vt")==="dateTime") { let table=document.createElement('table');