📄 clients.htm
字号:
<html xmlns:commonSource>
<head>
<title>Edit Clients</title>
</head>
<script Language="JavaScript">
function navigate(direction){
switch(direction){
case "next":
clientList.recordset.MoveNext();
tblList.nextPage();
break;
case "last":
clientList.recordset.MoveLast();
tblList.lastPage();
break;
case "previous":
clientList.recordset.MovePrevious();
tblList.previousPage();
break;
case "first":
clientList.recordset.MoveFirst();
tblList.firstPage();
break;
}
}
function addclient(){
clientList.recordset.addNew();
clientList.recordset.MoveLast();
tblList.lastPage();
}
function deleteclient(){
clientList.recordset.Delete();
tblList.firstPage();
clientList.recordset.MoveFirst();
}
function initialize(){
dropDown.async = false;
dropDown.load("dropDown.xml");
var root = dropDown.selectSingleNode("//column[@columnIndex='2']");
var clonedRoot = root.cloneNode(true);
clonedRoot.removeAttribute("columnIndex");
clientList.async = false;
xmlString = clonedRoot.xml;
var regExp = new RegExp("xmlns=\".*\"");
withoutXMLNS = xmlString.replace(regExp, "");
clientList.loadXML(withoutXMLNS);
clientList.recordset.MoveFirst();
}
function saveClientList(){
clientList.documentElement.setAttribute("columnIndex", "2");
var oldElement = dropDown.selectSingleNode("//column[@columnIndex='2']");
dropDown.documentElement.replaceChild(clientList.documentElement, oldElement);
var dataPath = common.getDataPath();
common.saveXMLDocument(dropDown, dataPath + "dropDown.xml");
window.close();
}
</script>
<commonSource:source ID="common" STYLE="behavior:url(commonSource.htc)" />
<xml ID="dropDown"></xml>
<xml ID="clientList"></xml>
<body onLoad="initialize()">
<B>Client List:</B><BR><BR>
<table ID="tblList" DATASRC="#clientList" border="1" align="center" DATAPAGESIZE="1">
<tr>
<td><b>Code:</b></td>
<td><input type="text" DATAFLD="value"></td>
</tr>
<tr>
<td><b>Name:</b></td>
<td><input type="text" DATAFLD="$Text"></td>
</tr>
</table>
<p align="center">
<input type="button" value="<<" onClick="navigate('first')"><input type="button" value="<" onClick="navigate('previous')">
<input type="button" value=">" onClick="navigate('next')"><input type="button" value=">>" onClick="navigate('last')"></p>
<p align="center"><input type="button" value="Add" onClick="addclient()">
<input type="button" value="Delete" onClick="deleteclient()"> <input type="button" value="Save" onClick="saveClientList()"> <input type="button" value="Cancel" onClick="window.close()"></p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -