📄 submitform.js
字号:
function fn_OnSubmit(that) {
var qt = document.getElementById("QueryTable");
var qr = document.getElementById("QueryResult");
if ( qt == null || qr == null ) return true;
try {
var inputs = qt.getElementsByTagName("INPUT");
var selects = qt.getElementsByTagName("SELECT");
if ( qr.caption == null ) {
qr.createCaption();
}
else {
// 清除原先设置的内容。
while ( qr.caption.childNodes.length > 0 ) {
qr.caption.removeChild(qr.caption.childNodes[0]);
}
}
for ( var i = 0; i<inputs.length; i++ ) {
if ( inputs[i].value == "" || inputs[i].name == "" ) continue;
var newInput = document.createElement("<INPUT NAME='" + inputs[i].name + "'>");
newInput.value = inputs[i].value;
qr.caption.appendChild(newInput);
}
for ( var i = 0; i<selects.length; i++ ) {
var sValue = selects[i].value;
if ( selects[i].disabled ) {
for ( var j =0; j<selects[i].options.length; j++ ) {
if ( selects[i].options(j).selected ) {
sValue=selects[i].options(j).value;
}
}
}
if ( sValue == "" || selects[i].name == "") continue;
// TODO 扩展支持允许多选的操作
var newInput = document.createElement("<INPUT NAME='" + selects[i].name + "'>");
newInput.value = selects[i].value;
qr.caption.appendChild(newInput);
}
qr.reload();
}
catch(ex){
alert(ex.description);
}
return false;
}
function fnQueryReload() {
// 重新加载查询结果。
var result = document.getElementById("Result");
var qr = document.getElementById("QueryResult");
try {
var aLink = qr.tBodies[0].rows(0).getElementsByTagName("A");
for ( var i=0; i<aLink.length; i++) {
if ( aLink[i].style.fontWeight == "bold" ) {
// 当前状态;
sHistoryStateName = aLink[i].name;
sHistoryStateValue = aLink[i].value;
break;
}
}
qr.reload();
}
catch(ex){
}
}
var sHistoryStateName = null;
var sHistoryStateValue = null;
function onQueryResultLoad() {
var qr = document.getElementById("QueryResult");
var aLink = qr.getElementsByTagName("A");
if ( sHistoryStateName == null && sHistoryStateValue == null) {
if(aLink != null && aLink.length > 0)
aLink[0].click();
else {
var rt = document.getElementById("Result");
while(rt.rows.length > 0 ) {
rt.deleteRow(0);
}
}
}
else {
if ( aLink != null && aLink.length > 0 ) {
for ( var i = 0; i<aLink.length; i++) {
if ( aLink[i].name == sHistoryStateName && aLink[i].value == sHistoryStateValue ) {
aLink[i].click();
sHistoryStateName = null;
sHistoryStateValue = null;
break;
}
}
if ( sHistoryStateName != null ) {
aLink[0].click();
sHistoryStateName = null;
sHistoryStateValue = null;
}
}
else{
var rt = document.getElementById("Result");
while(rt.rows.length > 0 ) {
rt.deleteRow(0);
}
}
}
}
var oldLinka = null;
function switchPage(that, idx){
if ( that.tagName == "A" ) {
document.getElementById("Result").currentPage=idx;
if ( oldLinka == null ) {
oldLinka = pageSet.children(0);
}
oldLinka.style.fontWeight = "normal";
oldLinka.style.fontSize = "9pt";
that.style.fontWeight = "bold";
that.style.fontSize = "10pt";
oldLinka = that;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -