일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- PLSQL
- dock
- 가우스
- oracle
- tomcat
- PHP
- WebLogic
- jsr 296
- jQuery
- appspresso
- ibsheet
- Google Map
- JSON
- Spring
- Eclipse
- phonegap
- GPS
- 전자정부프레임워크
- rowspan
- MFC
- MySQL
- iBATIS
- Android
- JDOM
- 선택적조인
- sencha touch
- swingx
- Ajax
- Struts
- node.js
Archives
- Today
- Total
Where The Streets Have No Name
동적으로 dataSet, Grid추가 본문
<script language=Javascript>
var glCount = 0;
function fncCreate(){
var oContainer = document.getElementById("spContainer");
var dsNode = document.createElement("object");
var gridNode = document.createElement("object");
/* dataSet attribute setting */
with(dsNode){
classid="clsid:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49";
id="Tb_DataSet"+glCount;
dataid="data.csv";
}
oContainer.appendChild(dsNode);
dsNode.reset();
/* checkbox add */
var checkNode = document.createElement("<input type='checkbox' id='check"+glCount+"' name='chkDel' onClick='fncOnCheck(this)'>check"+glCount+"</input>");
oContainer.appendChild(checkNode);
/* grid attribute setting */
with(gridNode){
classid="clsid:1F57AEAD-DB12-11D2-A4F9-00608CEBEE49";
id="Tb_Grid"+glCount;
style.value="width:500;height:100px;";
dataid="Tb_DataSet"+glCount;
format = "<c> id=col01 name="+glCount+" width=100 </c>";
}
oContainer.appendChild(gridNode);
//alert(container.innerHTML);
glCount++;
}
function fncAllDelete(){
var oContainer = document.getElementById("spContainer");
/* childNode의 끝에서부터 삭제 */
for(var i=oContainer.children.length-1; i >= 0; i--){
var oChild = oContainer.children(i);
oContainer.removeChild(oChild);
}
glCount = 0;
}
function fncOnCheck(arg){
//alert(arg.id+":"+arg.checked);
}
function fncDelete(){
var chkDel = document.getElementsByName("chkDel");
var oContainer = document.getElementById("spContainer");
/* 삭제 */
for(var i=0;i < chkDel.length;i++){
if(chkDel[i].checked){
var tmp = chkDel[i].id;
var num = tmp.substr(5,tmp.length);
var oTarget = document.getElementById("check"+num);
oContainer.removeChild(oTarget);
oTarget = document.getElementById("Tb_Grid"+num);
oContainer.removeChild(oTarget);
oTarget = document.getElementById("Tb_DataSet"+num);
oContainer.removeChild(oTarget);
}
}
}
</script>
<input type="button" value="create" OnClick="fncCreate()">
<input type="button" value="all delete" OnClick="fncAllDelete()">
<input type="button" value="delete" OnClick="fncDelete()">
<span id=spContainer>
</span>
var glCount = 0;
function fncCreate(){
var oContainer = document.getElementById("spContainer");
var dsNode = document.createElement("object");
var gridNode = document.createElement("object");
/* dataSet attribute setting */
with(dsNode){
classid="clsid:3267EA0D-B5D8-11D2-A4F9-00608CEBEE49";
id="Tb_DataSet"+glCount;
dataid="data.csv";
}
oContainer.appendChild(dsNode);
dsNode.reset();
/* checkbox add */
var checkNode = document.createElement("<input type='checkbox' id='check"+glCount+"' name='chkDel' onClick='fncOnCheck(this)'>check"+glCount+"</input>");
oContainer.appendChild(checkNode);
/* grid attribute setting */
with(gridNode){
classid="clsid:1F57AEAD-DB12-11D2-A4F9-00608CEBEE49";
id="Tb_Grid"+glCount;
style.value="width:500;height:100px;";
dataid="Tb_DataSet"+glCount;
format = "<c> id=col01 name="+glCount+" width=100 </c>";
}
oContainer.appendChild(gridNode);
//alert(container.innerHTML);
glCount++;
}
function fncAllDelete(){
var oContainer = document.getElementById("spContainer");
/* childNode의 끝에서부터 삭제 */
for(var i=oContainer.children.length-1; i >= 0; i--){
var oChild = oContainer.children(i);
oContainer.removeChild(oChild);
}
glCount = 0;
}
function fncOnCheck(arg){
//alert(arg.id+":"+arg.checked);
}
function fncDelete(){
var chkDel = document.getElementsByName("chkDel");
var oContainer = document.getElementById("spContainer");
/* 삭제 */
for(var i=0;i < chkDel.length;i++){
if(chkDel[i].checked){
var tmp = chkDel[i].id;
var num = tmp.substr(5,tmp.length);
var oTarget = document.getElementById("check"+num);
oContainer.removeChild(oTarget);
oTarget = document.getElementById("Tb_Grid"+num);
oContainer.removeChild(oTarget);
oTarget = document.getElementById("Tb_DataSet"+num);
oContainer.removeChild(oTarget);
}
}
}
</script>
<input type="button" value="create" OnClick="fncCreate()">
<input type="button" value="all delete" OnClick="fncAllDelete()">
<input type="button" value="delete" OnClick="fncDelete()">
<span id=spContainer>
</span>