js dynamic delete a row
来源:互联网 发布:软件可靠性分析方法 编辑:程序博客网 时间:2024/06/13 05:09
<%//Deletes the selected rows from the objects array and redraws the grid%>
function fndeletecriteria() {
var tarr = new Array();
var recordSelected = false;
for(var i=0;i<farr.length;i++) {
if( ! eval("document.filterfrm.chkrow" + i).checked) {
tarr[tarr.length] = farr[i]
}else{
recordSelected = true;
}
}
if(!recordSelected) {
alert("<gtl:content service='jsLabel' contentID='Filter_noSelectted'/>");
}
farr = tarr;
fndrawgrid();
document.filterfrm.selfield.focus();
}
<%//Clears the rows from the objects array and redraws the grid%>
function fnclear() {
farr = new Array()
document.filterfrm.reset();
fndrawgrid()
}
<%//function for drawing the grid%>
function fndrawgrid() {
var str = new String();
str = str + "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
str = str + "<tr>"
str = str + "<td bordercolor='#FFFFFF' bgcolor='#FFFFFF'> </td>"
str = str + "</tr>"
str = str + "<tr>"
str = str + "<td bordercolor='#FFFFFF' bgcolor='#FFFFFF'> </td>"
str = str + "</tr>"
str = str + "<tr>"
str = str + "<td bordercolor='#FFFFFF' bgcolor='#FFFFFF'> </td>"
str = str + "</tr>"
str = str + "<tr>"
str = str + "<td bordercolor='#FFFFFF' bgcolor='#FFFFFF'>"
str = str + "<table width='90%' border='0' cellspacing='0' cellpadding='0' align='center'>"
str = str + "<tr>"
str = str + "<td bordercolor='#FFFFFF' bgcolor='c0c0c0'>"
str = str + "<table width='100%' border='0' cellspacing='1' cellpadding='0' align='center' bordercolor='#CCCCCC'>"
str = str + "<tr bgcolor=f1f1f1 height='30px' align='center'>"
str = str + "<td width='6%' align='center' height='18'> </td>"
str = str + '<td width="23%" height="18"><b><gtl:content contentID="Filter_grid_Field" /></b></td>'
str = str + '<td width="22%" height="18"><b><gtl:content contentID="Filter_grid_operator" /></b></td>'
str = str + '<td width="23%" height="18"><b><gtl:content contentID="Filter_grid_value" /></b></td>'
str = str + '<td width="26%" height="18"><b><gtl:content contentID="Filter_grid_clause" /></b></td>'
str = str + "</tr>"
if(farr.length == 0) {
}else {
for(var i=0;i<farr.length;i++) {
str = str + "<tr align='center' bgcolor=ffffff style='font-style:Tohoma;font-size:13'>"
str = str + "<td width='6%' align='center'>"
str = str + "<input type='checkbox' name='chkrow" + i + "' value='on'>"
str = str + "</td>"
str = str + "<td width='23%' align='center'>" + farr[i].ffieldname + "</td>"
//str = str + "<td width='22%' align='center'>" + farr[i].foperator + "</td>"
if(farr[i].foperator == "LIKE" && farr[i].fvalue.charAt(0)!="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)=="%"){
str = str + "<td width='22%' align='center'>STARTS WITH</td>"
} else if(farr[i].foperator == "LIKE" && farr[i].fvalue.charAt(0)=="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)!="%"){
str = str + "<td width='22%' align='center'>ENDS WITH</td>"
} else if(farr[i].foperator == "LIKE" && farr[i].fvalue.charAt(0)=="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)=="%"){
str = str + "<td width='22%' align='center'>CONTAINS</td>"
} else if(farr[i].foperator == "NOT LIKE" && farr[i].fvalue.charAt(0)!="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)=="%"){
str = str + "<td width='22%' align='center'>DOES NOT STARTS WITH</td>"
} else if(farr[i].foperator == "NOT LIKE" && farr[i].fvalue.charAt(0)=="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)!="%"){
str = str + "<td width='22%' align='center'>DOES NOT ENDS WITH</td>"
} else if(farr[i].foperator == "NOT LIKE" && farr[i].fvalue.charAt(0)=="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)=="%"){
str = str + "<td width='22%' align='center'>DOES NOT CONTAINS</td>"
} else{
str = str + "<td width='22%' align='center'>" + farr[i].foperator + "</td>"
}
if(farr[i].foperator == "IS NULL" || farr[i].foperator == "IS NOT NULL") {
str = str + "<td width='23%' align='center'> </td>"
}
else{
if(farr[i].fvalue.charAt(0)!="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)=="%" ){
str = str + "<td width='23%' align='center'>" + farr[i].fvalue.substr(0,farr[i].fvalue.length-1) + "</td>"
} else if( farr[i].fvalue.charAt(0)=="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)!="%" ){
str = str + "<td width='23%' align='center'>" + farr[i].fvalue.substr(1,farr[i].fvalue.length-1) + "</td>"
} else if( farr[i].fvalue.charAt(0)=="%" && farr[i].fvalue.charAt(farr[i].fvalue.length-1)=="%" ){
str = str + "<td width='23%' align='center'>" + farr[i].fvalue.substr(1,farr[i].fvalue.length-2) + "</td>"
}
else{
str = str + "<td width='23%' align='center'>" + farr[i].fvalue + "</td>"
}
}
str = str + "<td width='26%' align='center'>" + farr[i].fclause + "</td>"
str = str + "</tr>"
}
}
str = str + "</table>"
str = str + "</td>"
str = str + "</tr>"
str = str + "</table>"
str = str + "</td>"
str = str + "</tr>"
str = str + "</table>"
document.all['dynatext'].innerHTML = str;
}
- js dynamic delete a row
- JS Delete Table Row
- csharp DataTable and DataGridView delete a Row
- csharp DataTable and DataGridView delete a Row
- Cannot delete or update a parent row
- Delete a Row from UITableView and Model-View-Controller
- mysql 出现Cannot delete or update a parent row:
- 待解决,Cannot delete or update a parent row
- JS:Insert and Delete row under current line
- Dynamic grid row command
- javascript table delete row
- Xcode: Delete row shortcut
- Cannot delete or update a parent row: a foreign key constraint fails
- MYSQL "Cannot delete or update a parent row: a foreign key constraint fails "
- jbpm Cannot delete or update a parent row: a foreign key constraint fails
- MySQL错误号1451-Cannot delete or update a parent row: a foreign key constraint fails
- Cannot delete or update a parent row: a foreign key constraint fails
- MYSQL: Cannot delete or update a parent row: a foreign key constraint fails
- 我写的bootloader代码,用nasm编写
- 深入理解abstract class和interface
- JS array delete element
- linux中去掉敲命令时用 tab 发出“嘀”的声音
- ElGamal算法
- js dynamic delete a row
- 项目管理
- 数据绑定
- sysbase 的特殊性,特殊对待
- ASP.NET操作EXCEL时出现的错误 Retrieving the COM class factory for component with CLSID
- 2007年6月CSDN读书排行榜:《SQL必知必会》
- SQL 错误 1069的解决办法
- DataGridView实现添加合计行并始终显示在底部
- 哎,比较浮躁