- 浏览: 111388 次
- 性别:
- 来自: 长沙
文章分类
最新评论
-
guanglizi:
V和\2表示什么?好像没见过
javascript常用日期验证 -
梅花簪:
不支持chrome,ff
固定表头列头Javascript代码 -
xy5811:
新浪微博应该不是直接用的这个算法,至少chars数组中顺序不一 ...
微博短链接的生成算法(Java版本) -
struts_2010:
...
MyEclipse 6.5 GA 下载 + 汉化方法 + 序列号 -
闫村林:
...
spring Hibernate struts整合配置(一)
<%@ page import="java.util.Date"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<%@ taglib uri="/tlds/chooser.tld" prefix="chooser" %>
<%--<%@ include file="/WEB-INF/jsp/common/messages.jsp" %>--%>
<%@ page language="java" pageEncoding="GB2312" contentType="text/html;charset=utf-8" buffer="none"%>
<script type="text/javascript" src="<c:url value='/scripts/public.js'/>" charset="gb2312"></script>
<script language="javascript" src="<c:url value='/scripts/PopupCalendar.js'/>"></script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title><bean:message key="market.letter.main.title"/></title>
<STYLE type=text/css>A:link {
COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
COLOR: 5BBF04; TEXT-DECORATION: none
}
A:active {
COLOR: #85F127}
A:hover {
COLOR:E9730B; TEXT-DECORATION: none
}
TD {
COLOR: #000000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt
}
</STYLE>
<script >
var oCalendarEn=new PopupCalendar("oCalendarEn"); //初始化控件时,请给出实例名称如:oCalendarEn
oCalendarEn.Init();
var oCalendarChs=new PopupCalendar("oCalendarChs"); //初始化控件时,请给出实例名称:oCalendarChs
oCalendarChs.weekDaySting=new Array("日","一","二","三","四","五","六");
oCalendarChs.monthSting=new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
oCalendarChs.oBtnTodayTitle="今天";
oCalendarChs.oBtnCancelTitle="取消";
oCalendarChs.Init();
</script>
<script language=javascript>
function addTableRow(tableName){
var table=document.all(tableName);
var rows=table.rows;
var rowcount=rows.length;
var rowN=rows.length+1;
// alert(rowN);
var centrow=table.insertRow(rowcount);
var cells=centrow.cells;
var cell0=rows(centrow.rowIndex).insertCell(cells.length);
var cell1=rows(centrow.rowIndex).insertCell(cells.length);
var cell2=rows(centrow.rowIndex).insertCell(cells.length);
var cell3=rows(centrow.rowIndex).insertCell(cells.length);
var cell4=rows(centrow.rowIndex).insertCell(cells.length);
var cell5=rows(centrow.rowIndex).insertCell(cells.length);
var cell6=rows(centrow.rowIndex).insertCell(cells.length);
cell2.align="center";
if(parseInt(rowcount)>8)
cell0.innerHTML='<label></label> :<input type="checkbox" name="idArr"/> ';
else
cell0.innerHTML='<label></label> :<input type="checkbox" name="idArr"/> ';
cell1.innerHTML='<input type=text name="contents" />';
cell2.innerHTML='<input type=text name="targets" size="15" />';
cell3.innerHTML='<input type=text name="prompts" readOnly size="8" onclick="getDateString(this,oCalendarChs)"/>';
cell4.innerHTML='<select name="taskLevels"><option value="1"><bean:message key="market.task.taskLevel1"/></option>'+
'<option value="2"><bean:message key="market.task.taskLevel2"/></option>'+
'<option value="3"><bean:message key="market.task.taskLevel3"/></option>' +
'<option value="4"><bean:message key="market.task.taskLevel4"/></option></select>';
cell5.innerHTML='<input type=text readOnly onclick="return initSearch('+"'assortUsersN"+ rowN+"'"+','+"'assortUsers"+rowN+"'"+')" name="assortUsersN'+ rowN+'"/>'+
'<input type="hidden" name="assortUsers'+ rowN+'"/>';
/* '<a href="#" onclick="return initSearch('+"'assortUsersN"+ rowN+"'"+','+"'assortUsers"+rowN+"'"+')">' +
'<bean:message key="enginechange.selectPeople"/></a>';*/
// alert('<input type=text name="assortUsersN'+ rowN+'"/>');
cell6.innerHTML='<input type=text name="remarks" size="15"/><html:hidden property="userIds" value=""/>'+
'<html:hidden property="schedules" value="0"/>'+
'<html:hidden property="evolves" value=""/>'+
'<html:hidden property="difficultys" value=""/>'+
'<html:hidden property="scheduleNos" value="0"/>'+
'<html:hidden property="addPlaces" value="0"/>';
cell0.children[0].innerHTML=rowcount+1;
}
function addRowWithContent(rowNum,content,target,prompt,taskLevel,assortUser,remark,userId,schedule,difficulty,scheduleNo,addPlace,evolve,assortUsersN){
addTableRow("dynamicTable");
var table=document.all("dynamicTable");
var rowCount=table.rows.length;
var cell=table.rows(rowCount-1).cells(0);
var obj=cell.children[0];
obj.innerHTML=rowNum+1;
cell=table.rows(rowCount-1).cells(1);
obj=cell.children[0];
obj.value=content;
cell=table.rows(rowCount-1).cells(2);
obj=cell.children[0];
obj.value=target;
cell=table.rows(rowCount-1).cells(3);
obj=cell.children[0];
obj.value=prompt;
cell=table.rows(rowCount-1).cells(4);
obj=cell.children[0];
obj.value=taskLevel;
cell=table.rows(rowCount-1).cells(5);
obj=cell.children[0];
obj.value=assortUsersN;
cell=table.rows(rowCount-1).cells(5);
obj=cell.children[1];
obj.value=assortUser;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[0];
obj.value=remark;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[1];
obj.value=userId;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[2];
obj.value=schedule;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[3];
obj.value=evolve;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[4];
obj.value=difficulty;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[5];
obj.value=scheduleNo;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[6];
obj.value=addPlace;
}
function removeElements(tableName){
var table=document.all(tableName);
var votedetailcheckboxs=document.all.idArr;
//only one
if(votedetailcheckboxs.tagName=="input"){
}
for(i=votedetailcheckboxs.length-1;i>=0;i--){
if(votedetailcheckboxs(i).checked){
table.rows(i).removeNode(true);
}
}
for(i=0;i<table.rows.length;i++){
var cell=table.rows(i).cells(0);
var obj=cell.children[0];
obj.innerHTML=i+1;
//------------------------------------------
//删除时动态修改配合人员属性名称:保证数据修改后录入正确:
cell=table.rows(i).cells(5);
obj=cell.children[0];
obj.name="assortUsersN"+(i+1);
// alert(obj.name);
cell=table.rows(i).cells(5);
obj=cell.children[1];
obj.name="assortUsers"+(i+1);
}
}
function save(){
var form = document.forms[0];
if(!validateForm(form))return;
form.action = "<c:url value="/task.do?method=save"/>";
form.submit();
}
function validateForm(form){
var table=document.all("dynamicTable");
var rowCount=table.rows.length;
var regex=/^\s*$/;
var cell1;
var taskDetailTitle;
for(var i=0;i<rowCount;i++){
cell1=table.rows(i).cells(1);
taskDetailTitle=cell1.children[0];
if(taskDetailTitle.value==null||taskDetailTitle.value==''||regex.test(taskDetailTitle.value)){
alert("<bean:message key='voteDetailTitle_required' />");
taskDetailTitle.focus();
return false;
}
}
return true;
}
function search(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=add"/>";
form.submit();
}
function getSendUserId(userObj)
{
document.getElementById("assortUsersN").value = userObj[1];
document.getElementById("assortUsers").value = userObj[0];
}
function tjTask(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=TjApprove"/>";
form.submit();
}
function back(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=mainTask"/>";
form.submit();
}
function add(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=add&menuId=187&sysId=2007041701"/>";
form.submit();
}
function gotoApprove(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=gotoApprove&menuId=190&sysId=2007041701"/>";
form.submit();
} function gotoComment(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=goComment&menuId=191&sysId=2007041701"/>";
form.submit();
}
function gotoSchedule(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=scheduleList&menuId=188&sysId=2007041701"/>";
form.submit();
}function gotoSummarize(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=summarize&menuId=189&sysId=2007041701"/>";
form.submit();
}
function gotoMemo()
{
var form=document.forms[0];
form.action="<c:url value="/task.do?method=gotoMemo&menuId=192&sysId=2007041701"/>";
form.submit();
}
function initSearch(eName, eId)
{
var form = document.forms['taskForm'];
var e = document.forms['taskForm'].all("type");
document.forms['taskForm'].all("type").value = '';
if(e != null)
{
window.showModalDialog("task.do?method=getGroupListByEmployee&retObj=type", window, 'dialogheight:450px;dialogwidth:350px;dialogleft:200px;dialogtop:200px;status:no;help:no');
var returnValue = document.forms['taskForm'].all("type").value;
if(returnValue != '')
{
var str = returnValue.split('@');
document.forms['taskForm'].all(eId).value = str[0];
document.forms['taskForm'].all(eName).value = str[1];
}
}
}
</script>
</head>
<body>
<jsp:include page="../../letter/marketContentTop.jsp"></jsp:include>
<html:form action="task.do?method=save" styleId="taskForm">
<html:hidden property="type"/>
<html:hidden property="sysId" value="${sysId}"/>
<html:hidden property="menuId" value="${menuId}"/>
<html:hidden property="tbMartTaskMonthly.monthlyId" value="${tbMartTaskMonthly.monthlyId}"/>
<html:hidden property="tbMartTaskMonthly.auditing" value="${tbMartTaskMonthly.auditing}"/>
<html:hidden property="tbMartTaskMonthly.leadComment" value="${tbMartTaskMonthly.leadComment}"/>
<html:hidden property="tbMartTaskMonthly.noSummarize" value="${tbMartTaskMonthly.noSummarize}"/>
<html:hidden property="tbMartTaskMonthly.auditingContent" value="${tbMartTaskMonthly.auditingContent}"/>
<html:hidden property="tbMartTaskMonthly.commentNum" value="${tbMartTaskMonthly.commentNum}"/>
<html:hidden property="tbMartTaskMonthly.commnetExplain" value="${tbMartTaskMonthly.commnetExplain}"/>
<table border="1" width="770" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<!-------------------->
<tr>
<td width="100%" height="12" valign="top">
<table>
<tr>
<td colspan="7"valign="top" align="center">
<a href="#" onclick="return add();" ><bean:message key="market.task.monthly"/></a>
<a href="#" onclick="return gotoSchedule();"><bean:message key="market.task.schUp"/></a>
<a href="#" onclick="return gotoSummarize();"><bean:message key="market.task.zj"/></a>
<a href="#" onclick="return gotoApprove();"><bean:message key="market.task.taskSh"/></a>
<a href="#" onclick="return gotoComment();"><bean:message key="market.task.taskKp"/></a>
<a href="#" onclick="return gotoMemo()"> <bean:message key="market.task.dsUp"/></a>
</td>
</tr>
<tr>
<td colspan="7" align="center"><strong><bean:message key="market.task.monthly"/></strong></td>
</tr>
<tr>
<td width="760" colspan="7" valign="top">
<strong><bean:message key="market.task.month"/></strong>
<select name="year">
<% String year=(String)request.getAttribute("year");
Date today=new Date();
for(int i=5;i>=1;i--){
String y2=Integer.toString(today.getYear()+1900-i);
// System.out.println("y2 "+y2+ "year"+year +" "+y2.toString().equals(year));
if(y2.toString().equals(year)){
%>
<option selected value="<%=today.getYear()+1900-i%>"><%=today.getYear()+1900-i%></option>
<%
}else{
%>
<option value="<%=today.getYear()+1900-i%>"><%=today.getYear()+1900-i%></option>
<% }
}
String y2=Integer.toString(today.getYear()+1900);
if(y2.equals(year)){
%>
<option selected value="<%=today.getYear()+1900%>"><%=today.getYear()+1900%></option>
<%
}else{
%>
<option value="<%=today.getYear()+1900%>"><%=today.getYear()+1900%></option>
<% }
for(int a=1;a<=5;a++){
y2=Integer.toString(today.getYear()+1900+a);
if(y2.equals(year)){
%>
<option selected value="<%=today.getYear()+1900+a%>"><%=today.getYear()+1900+a%></option>
<%}else{%>
<option value="<%=today.getYear()+1900+a%>"><%=today.getYear()+1900+a%></option>
<%}}%>
</select>
<bean:message key="market.letter.sendMartInfo.year"/>
<select name="month">
<%
String month=(String)request.getAttribute("month");
String m2="";
for(int j=today.getMonth();j>=1;j--){
m2=Integer.toString(today.getMonth()+1-j);
if(month.equals(m2)){
%>
<option selected value="<%=today.getMonth()+1-j %>" ><%=today.getMonth()+1-j %></option>
<%}else{%>
<option value="<%=today.getMonth()+1-j %>" ><%=today.getMonth()+1-j %></option>
<%}}%>
<%
m2=Integer.toString(today.getMonth()+1);
if(month.equals(m2)){
%>
<option selected value="<%=today.getMonth()+1%>"><%=today.getMonth()+1%></option>
<%}else{%>
<option value="<%=today.getMonth()+1%>"><%=today.getMonth()+1%></option>
<%}
for(int b=1;b<=12-(today.getMonth()+1);b++){
m2=Integer.toString(today.getMonth()+1+b);
if(month.equals(m2)){
%>
<option selected value="<%=today.getMonth()+1+b%>"><%=today.getMonth()+1+b%></option>
<%}else{ %>
<option value="<%=today.getMonth()+1+b%>"><%=today.getMonth()+1+b%></option>
<%} }%>
</select>
<bean:message key="market.letter.sendMartInfo.month"/>
<input alt="<bean:message key="market.letter.marketing.search"/>" type="image" src="images/scjy/search.gif" id="image1" name="image1" WIDTH="22" HEIGHT="18" onClick="search();">
</td>
</tr>
<tr width="760" valign="top" height="12">
<td nowrap="true" width="50" valign="top" align="center"><strong><bean:message key="market.task.no"/></strong></td>
<td width="120" valign="top" align="center"><strong><bean:message key="market.task.content"/></strong></td>
<td width="90" valign="top" align="center"><strong><bean:message key="market.task.tarGet"/></strong></td>
<td width="70" valign="top" align="center"><strong><bean:message key="market.task.prompt"/></strong></td>
<td width="70"valign="top"align="center"><strong><bean:message key="market.task.taskLevel"/></strong></td>
<td nowrap="true" width="150" valign="top"align="center"><strong><bean:message key="market.task.assortUers"/></strong></td>
<td width="100"valign="top"align="center"><strong><bean:message key="market.task.remark"/></strong></td>
</tr>
</table>
<TABLE width="760" valign="top" height="12" border="1"
name="dynamicTable" id="dynamicTable">
<tr>
<td width="50"align="center">1:<html:checkbox property="idArr"/></td>
<td width="140"align="center"><html:text property="contents" value=""/></td>
<td width=""align="center"><html:text property="targets" value="" size="15"/></td>
<td width=""align="center"><html:text property="prompts" readonly="true" size="8" value="" onclick="getDateString(this,oCalendarChs)"/>
</td>
<td width=""valign="center">
<html:select property="taskLevels">
<option value="1"><bean:message key="market.task.taskLevel1"/></option>
<option value="2"><bean:message key="market.task.taskLevel2"/></option>
<option value="3"><bean:message key="market.task.taskLevel3"/></option>
<option value="4"><bean:message key="market.task.taskLevel4"/></option>
</html:select>
</td>
<td nowrap="true" width=""align="center"><input type="text" name="assortUsersN1" value="" readonly="true" onclick="return initSearch('assortUsersN1','assortUsers1')"/>
<input type="hidden" name="assortUsers1" value=""/>
<%-- <a href="#" onclick="return initSearch('assortUsersN1','assortUsers1')">
<bean:message key="enginechange.selectPeople"/></a>--%>
</td>
<td align="center"><html:text property="remarks" size="15" value="" />
<html:hidden property="userIds" value=""/>
<html:hidden property="schedules" value="0"/>
<html:hidden property="evolves" value=""/>
<html:hidden property="difficultys" value=""/>
<html:hidden property="scheduleNos" value="0"/>
<html:hidden property="addPlaces" value="0"/>
</td>
</tr>
</TABLE>
</td>
</tr>
<tr>
<td width="770" height="12" valign="top" align="center">
<c:if test="${tbMartTaskMonthly.noSummarize=='0'|| tbMartTaskMonthly.noSummarize==null }">
<input type="button" name="addRow" value="<bean:message key="row_add"/>" onclick="addTableRow('dynamicTable')">
<input type="button" name="delRow" value="<bean:message key="row_del"/>" onclick="removeElements('dynamicTable')">
<input type="button" name="saveRow" value="<bean:message key="market.task.save"/>"
onclick="save()">
<input type="button" name="delRow" value="<bean:message key="market.task.sh"/>"
onclick="tjTask()">
</c:if>
<input type="button" name="delRow" value="<bean:message key="market.task.cent"/>"
onclick="back()">
</td>
</tr>
<!------------------------>
</td>
</table>
</html:form>
<jsp:include page="../../letter/mainEnd.jsp"></jsp:include>
</body>
</html>
<script type="text/javascript" language="javascript">
<c:if test="${tbMartTaskDetails!=null && !empty tbMartTaskDetails}" >
<c:forEach var="tbMartTaskDetail" items="${tbMartTaskDetails}" varStatus="status">
<c:choose>
<c:when test="${status.index==0}">
document.all.contents.value='<c:out value="${tbMartTaskDetail.content}"/>';
document.all.targets.value='<c:out value="${tbMartTaskDetail.target}"/>';
document.all.prompts.value='<fmt:formatDate value="${tbMartTaskDetail.prompt}" pattern="yyyy-MM-dd" />'
document.all.taskLevels.value='<c:out value="${tbMartTaskDetail.taskLevel}"/>';
document.all.assortUsers1.value='<c:out value="${tbMartTaskDetail.assortUser}"/>';
document.all.assortUsersN1.value='<c:out value="${assortUsersN0}"/>';
document.all.remarks.value='<c:out value="${tbMartTaskDetail.remark}"/>';
document.all.userIds.value='<c:out value="${tbMartTaskDetail.userId}"/>';
document.all.schedules.value='<c:out value="${tbMartTaskDetail.schedule}"/>';
document.all.evolves.value='<c:out value="${tbMartTaskDetail.evolve}"/>'
document.all.difficultys.value='<c:out value="${tbMartTaskDetail.difficulty}"/>';
document.all.scheduleNos.value='<c:out value="${tbMartTaskDetail.scheduleNo}"/>';
document.all.addPlaces.value='<c:out value="${tbMartTaskDetail.addPlace}"/>';
</c:when>
<c:otherwise>
<c:set var="n" value="${status.index}" scope="request" />
addRowWithContent(<c:out value="${status.index}"/>,'<c:out value="${tbMartTaskDetail.content}" />','<c:out value="${tbMartTaskDetail.target}" />',
'<fmt:formatDate value="${tbMartTaskDetail.prompt}"pattern="yyyy-MM-dd" />','<c:out value="${tbMartTaskDetail.taskLevel}" />' ,
'<c:out value="${tbMartTaskDetail.assortUser}" />','<c:out value="${tbMartTaskDetail.remark}" />',
'<c:out value="${tbMartTaskDetail.userId}" />','<c:out value="${tbMartTaskDetail.schedule}" />',
'<c:out value="${tbMartTaskDetail.difficulty}" />','<c:out value="${tbMartTaskDetail.scheduleNo}" />',
'<c:out value="${tbMartTaskDetail.addPlace}" />','<c:out value="${tbMartTaskDetail.evolve}"/>','<%=request.getAttribute("assortUsersN"+request.getAttribute("n"))%>');
</c:otherwise>
</c:choose>
</c:forEach>
</c:if>
</script>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<%@ taglib uri="/tlds/chooser.tld" prefix="chooser" %>
<%--<%@ include file="/WEB-INF/jsp/common/messages.jsp" %>--%>
<%@ page language="java" pageEncoding="GB2312" contentType="text/html;charset=utf-8" buffer="none"%>
<script type="text/javascript" src="<c:url value='/scripts/public.js'/>" charset="gb2312"></script>
<script language="javascript" src="<c:url value='/scripts/PopupCalendar.js'/>"></script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title><bean:message key="market.letter.main.title"/></title>
<STYLE type=text/css>A:link {
COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
COLOR: 5BBF04; TEXT-DECORATION: none
}
A:active {
COLOR: #85F127}
A:hover {
COLOR:E9730B; TEXT-DECORATION: none
}
TD {
COLOR: #000000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt
}
</STYLE>
<script >
var oCalendarEn=new PopupCalendar("oCalendarEn"); //初始化控件时,请给出实例名称如:oCalendarEn
oCalendarEn.Init();
var oCalendarChs=new PopupCalendar("oCalendarChs"); //初始化控件时,请给出实例名称:oCalendarChs
oCalendarChs.weekDaySting=new Array("日","一","二","三","四","五","六");
oCalendarChs.monthSting=new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
oCalendarChs.oBtnTodayTitle="今天";
oCalendarChs.oBtnCancelTitle="取消";
oCalendarChs.Init();
</script>
<script language=javascript>
function addTableRow(tableName){
var table=document.all(tableName);
var rows=table.rows;
var rowcount=rows.length;
var rowN=rows.length+1;
// alert(rowN);
var centrow=table.insertRow(rowcount);
var cells=centrow.cells;
var cell0=rows(centrow.rowIndex).insertCell(cells.length);
var cell1=rows(centrow.rowIndex).insertCell(cells.length);
var cell2=rows(centrow.rowIndex).insertCell(cells.length);
var cell3=rows(centrow.rowIndex).insertCell(cells.length);
var cell4=rows(centrow.rowIndex).insertCell(cells.length);
var cell5=rows(centrow.rowIndex).insertCell(cells.length);
var cell6=rows(centrow.rowIndex).insertCell(cells.length);
cell2.align="center";
if(parseInt(rowcount)>8)
cell0.innerHTML='<label></label> :<input type="checkbox" name="idArr"/> ';
else
cell0.innerHTML='<label></label> :<input type="checkbox" name="idArr"/> ';
cell1.innerHTML='<input type=text name="contents" />';
cell2.innerHTML='<input type=text name="targets" size="15" />';
cell3.innerHTML='<input type=text name="prompts" readOnly size="8" onclick="getDateString(this,oCalendarChs)"/>';
cell4.innerHTML='<select name="taskLevels"><option value="1"><bean:message key="market.task.taskLevel1"/></option>'+
'<option value="2"><bean:message key="market.task.taskLevel2"/></option>'+
'<option value="3"><bean:message key="market.task.taskLevel3"/></option>' +
'<option value="4"><bean:message key="market.task.taskLevel4"/></option></select>';
cell5.innerHTML='<input type=text readOnly onclick="return initSearch('+"'assortUsersN"+ rowN+"'"+','+"'assortUsers"+rowN+"'"+')" name="assortUsersN'+ rowN+'"/>'+
'<input type="hidden" name="assortUsers'+ rowN+'"/>';
/* '<a href="#" onclick="return initSearch('+"'assortUsersN"+ rowN+"'"+','+"'assortUsers"+rowN+"'"+')">' +
'<bean:message key="enginechange.selectPeople"/></a>';*/
// alert('<input type=text name="assortUsersN'+ rowN+'"/>');
cell6.innerHTML='<input type=text name="remarks" size="15"/><html:hidden property="userIds" value=""/>'+
'<html:hidden property="schedules" value="0"/>'+
'<html:hidden property="evolves" value=""/>'+
'<html:hidden property="difficultys" value=""/>'+
'<html:hidden property="scheduleNos" value="0"/>'+
'<html:hidden property="addPlaces" value="0"/>';
cell0.children[0].innerHTML=rowcount+1;
}
function addRowWithContent(rowNum,content,target,prompt,taskLevel,assortUser,remark,userId,schedule,difficulty,scheduleNo,addPlace,evolve,assortUsersN){
addTableRow("dynamicTable");
var table=document.all("dynamicTable");
var rowCount=table.rows.length;
var cell=table.rows(rowCount-1).cells(0);
var obj=cell.children[0];
obj.innerHTML=rowNum+1;
cell=table.rows(rowCount-1).cells(1);
obj=cell.children[0];
obj.value=content;
cell=table.rows(rowCount-1).cells(2);
obj=cell.children[0];
obj.value=target;
cell=table.rows(rowCount-1).cells(3);
obj=cell.children[0];
obj.value=prompt;
cell=table.rows(rowCount-1).cells(4);
obj=cell.children[0];
obj.value=taskLevel;
cell=table.rows(rowCount-1).cells(5);
obj=cell.children[0];
obj.value=assortUsersN;
cell=table.rows(rowCount-1).cells(5);
obj=cell.children[1];
obj.value=assortUser;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[0];
obj.value=remark;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[1];
obj.value=userId;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[2];
obj.value=schedule;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[3];
obj.value=evolve;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[4];
obj.value=difficulty;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[5];
obj.value=scheduleNo;
cell=table.rows(rowCount-1).cells(6);
obj=cell.children[6];
obj.value=addPlace;
}
function removeElements(tableName){
var table=document.all(tableName);
var votedetailcheckboxs=document.all.idArr;
//only one
if(votedetailcheckboxs.tagName=="input"){
}
for(i=votedetailcheckboxs.length-1;i>=0;i--){
if(votedetailcheckboxs(i).checked){
table.rows(i).removeNode(true);
}
}
for(i=0;i<table.rows.length;i++){
var cell=table.rows(i).cells(0);
var obj=cell.children[0];
obj.innerHTML=i+1;
//------------------------------------------
//删除时动态修改配合人员属性名称:保证数据修改后录入正确:
cell=table.rows(i).cells(5);
obj=cell.children[0];
obj.name="assortUsersN"+(i+1);
// alert(obj.name);
cell=table.rows(i).cells(5);
obj=cell.children[1];
obj.name="assortUsers"+(i+1);
}
}
function save(){
var form = document.forms[0];
if(!validateForm(form))return;
form.action = "<c:url value="/task.do?method=save"/>";
form.submit();
}
function validateForm(form){
var table=document.all("dynamicTable");
var rowCount=table.rows.length;
var regex=/^\s*$/;
var cell1;
var taskDetailTitle;
for(var i=0;i<rowCount;i++){
cell1=table.rows(i).cells(1);
taskDetailTitle=cell1.children[0];
if(taskDetailTitle.value==null||taskDetailTitle.value==''||regex.test(taskDetailTitle.value)){
alert("<bean:message key='voteDetailTitle_required' />");
taskDetailTitle.focus();
return false;
}
}
return true;
}
function search(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=add"/>";
form.submit();
}
function getSendUserId(userObj)
{
document.getElementById("assortUsersN").value = userObj[1];
document.getElementById("assortUsers").value = userObj[0];
}
function tjTask(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=TjApprove"/>";
form.submit();
}
function back(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=mainTask"/>";
form.submit();
}
function add(){
var form = document.forms[0];
form.action = "<c:url value="/task.do?method=add&menuId=187&sysId=2007041701"/>";
form.submit();
}
function gotoApprove(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=gotoApprove&menuId=190&sysId=2007041701"/>";
form.submit();
} function gotoComment(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=goComment&menuId=191&sysId=2007041701"/>";
form.submit();
}
function gotoSchedule(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=scheduleList&menuId=188&sysId=2007041701"/>";
form.submit();
}function gotoSummarize(){
var form=document.forms[0];
form.action="<c:url value="/task.do?method=summarize&menuId=189&sysId=2007041701"/>";
form.submit();
}
function gotoMemo()
{
var form=document.forms[0];
form.action="<c:url value="/task.do?method=gotoMemo&menuId=192&sysId=2007041701"/>";
form.submit();
}
function initSearch(eName, eId)
{
var form = document.forms['taskForm'];
var e = document.forms['taskForm'].all("type");
document.forms['taskForm'].all("type").value = '';
if(e != null)
{
window.showModalDialog("task.do?method=getGroupListByEmployee&retObj=type", window, 'dialogheight:450px;dialogwidth:350px;dialogleft:200px;dialogtop:200px;status:no;help:no');
var returnValue = document.forms['taskForm'].all("type").value;
if(returnValue != '')
{
var str = returnValue.split('@');
document.forms['taskForm'].all(eId).value = str[0];
document.forms['taskForm'].all(eName).value = str[1];
}
}
}
</script>
</head>
<body>
<jsp:include page="../../letter/marketContentTop.jsp"></jsp:include>
<html:form action="task.do?method=save" styleId="taskForm">
<html:hidden property="type"/>
<html:hidden property="sysId" value="${sysId}"/>
<html:hidden property="menuId" value="${menuId}"/>
<html:hidden property="tbMartTaskMonthly.monthlyId" value="${tbMartTaskMonthly.monthlyId}"/>
<html:hidden property="tbMartTaskMonthly.auditing" value="${tbMartTaskMonthly.auditing}"/>
<html:hidden property="tbMartTaskMonthly.leadComment" value="${tbMartTaskMonthly.leadComment}"/>
<html:hidden property="tbMartTaskMonthly.noSummarize" value="${tbMartTaskMonthly.noSummarize}"/>
<html:hidden property="tbMartTaskMonthly.auditingContent" value="${tbMartTaskMonthly.auditingContent}"/>
<html:hidden property="tbMartTaskMonthly.commentNum" value="${tbMartTaskMonthly.commentNum}"/>
<html:hidden property="tbMartTaskMonthly.commnetExplain" value="${tbMartTaskMonthly.commnetExplain}"/>
<table border="1" width="770" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<!-------------------->
<tr>
<td width="100%" height="12" valign="top">
<table>
<tr>
<td colspan="7"valign="top" align="center">
<a href="#" onclick="return add();" ><bean:message key="market.task.monthly"/></a>
<a href="#" onclick="return gotoSchedule();"><bean:message key="market.task.schUp"/></a>
<a href="#" onclick="return gotoSummarize();"><bean:message key="market.task.zj"/></a>
<a href="#" onclick="return gotoApprove();"><bean:message key="market.task.taskSh"/></a>
<a href="#" onclick="return gotoComment();"><bean:message key="market.task.taskKp"/></a>
<a href="#" onclick="return gotoMemo()"> <bean:message key="market.task.dsUp"/></a>
</td>
</tr>
<tr>
<td colspan="7" align="center"><strong><bean:message key="market.task.monthly"/></strong></td>
</tr>
<tr>
<td width="760" colspan="7" valign="top">
<strong><bean:message key="market.task.month"/></strong>
<select name="year">
<% String year=(String)request.getAttribute("year");
Date today=new Date();
for(int i=5;i>=1;i--){
String y2=Integer.toString(today.getYear()+1900-i);
// System.out.println("y2 "+y2+ "year"+year +" "+y2.toString().equals(year));
if(y2.toString().equals(year)){
%>
<option selected value="<%=today.getYear()+1900-i%>"><%=today.getYear()+1900-i%></option>
<%
}else{
%>
<option value="<%=today.getYear()+1900-i%>"><%=today.getYear()+1900-i%></option>
<% }
}
String y2=Integer.toString(today.getYear()+1900);
if(y2.equals(year)){
%>
<option selected value="<%=today.getYear()+1900%>"><%=today.getYear()+1900%></option>
<%
}else{
%>
<option value="<%=today.getYear()+1900%>"><%=today.getYear()+1900%></option>
<% }
for(int a=1;a<=5;a++){
y2=Integer.toString(today.getYear()+1900+a);
if(y2.equals(year)){
%>
<option selected value="<%=today.getYear()+1900+a%>"><%=today.getYear()+1900+a%></option>
<%}else{%>
<option value="<%=today.getYear()+1900+a%>"><%=today.getYear()+1900+a%></option>
<%}}%>
</select>
<bean:message key="market.letter.sendMartInfo.year"/>
<select name="month">
<%
String month=(String)request.getAttribute("month");
String m2="";
for(int j=today.getMonth();j>=1;j--){
m2=Integer.toString(today.getMonth()+1-j);
if(month.equals(m2)){
%>
<option selected value="<%=today.getMonth()+1-j %>" ><%=today.getMonth()+1-j %></option>
<%}else{%>
<option value="<%=today.getMonth()+1-j %>" ><%=today.getMonth()+1-j %></option>
<%}}%>
<%
m2=Integer.toString(today.getMonth()+1);
if(month.equals(m2)){
%>
<option selected value="<%=today.getMonth()+1%>"><%=today.getMonth()+1%></option>
<%}else{%>
<option value="<%=today.getMonth()+1%>"><%=today.getMonth()+1%></option>
<%}
for(int b=1;b<=12-(today.getMonth()+1);b++){
m2=Integer.toString(today.getMonth()+1+b);
if(month.equals(m2)){
%>
<option selected value="<%=today.getMonth()+1+b%>"><%=today.getMonth()+1+b%></option>
<%}else{ %>
<option value="<%=today.getMonth()+1+b%>"><%=today.getMonth()+1+b%></option>
<%} }%>
</select>
<bean:message key="market.letter.sendMartInfo.month"/>
<input alt="<bean:message key="market.letter.marketing.search"/>" type="image" src="images/scjy/search.gif" id="image1" name="image1" WIDTH="22" HEIGHT="18" onClick="search();">
</td>
</tr>
<tr width="760" valign="top" height="12">
<td nowrap="true" width="50" valign="top" align="center"><strong><bean:message key="market.task.no"/></strong></td>
<td width="120" valign="top" align="center"><strong><bean:message key="market.task.content"/></strong></td>
<td width="90" valign="top" align="center"><strong><bean:message key="market.task.tarGet"/></strong></td>
<td width="70" valign="top" align="center"><strong><bean:message key="market.task.prompt"/></strong></td>
<td width="70"valign="top"align="center"><strong><bean:message key="market.task.taskLevel"/></strong></td>
<td nowrap="true" width="150" valign="top"align="center"><strong><bean:message key="market.task.assortUers"/></strong></td>
<td width="100"valign="top"align="center"><strong><bean:message key="market.task.remark"/></strong></td>
</tr>
</table>
<TABLE width="760" valign="top" height="12" border="1"
name="dynamicTable" id="dynamicTable">
<tr>
<td width="50"align="center">1:<html:checkbox property="idArr"/></td>
<td width="140"align="center"><html:text property="contents" value=""/></td>
<td width=""align="center"><html:text property="targets" value="" size="15"/></td>
<td width=""align="center"><html:text property="prompts" readonly="true" size="8" value="" onclick="getDateString(this,oCalendarChs)"/>
</td>
<td width=""valign="center">
<html:select property="taskLevels">
<option value="1"><bean:message key="market.task.taskLevel1"/></option>
<option value="2"><bean:message key="market.task.taskLevel2"/></option>
<option value="3"><bean:message key="market.task.taskLevel3"/></option>
<option value="4"><bean:message key="market.task.taskLevel4"/></option>
</html:select>
</td>
<td nowrap="true" width=""align="center"><input type="text" name="assortUsersN1" value="" readonly="true" onclick="return initSearch('assortUsersN1','assortUsers1')"/>
<input type="hidden" name="assortUsers1" value=""/>
<%-- <a href="#" onclick="return initSearch('assortUsersN1','assortUsers1')">
<bean:message key="enginechange.selectPeople"/></a>--%>
</td>
<td align="center"><html:text property="remarks" size="15" value="" />
<html:hidden property="userIds" value=""/>
<html:hidden property="schedules" value="0"/>
<html:hidden property="evolves" value=""/>
<html:hidden property="difficultys" value=""/>
<html:hidden property="scheduleNos" value="0"/>
<html:hidden property="addPlaces" value="0"/>
</td>
</tr>
</TABLE>
</td>
</tr>
<tr>
<td width="770" height="12" valign="top" align="center">
<c:if test="${tbMartTaskMonthly.noSummarize=='0'|| tbMartTaskMonthly.noSummarize==null }">
<input type="button" name="addRow" value="<bean:message key="row_add"/>" onclick="addTableRow('dynamicTable')">
<input type="button" name="delRow" value="<bean:message key="row_del"/>" onclick="removeElements('dynamicTable')">
<input type="button" name="saveRow" value="<bean:message key="market.task.save"/>"
onclick="save()">
<input type="button" name="delRow" value="<bean:message key="market.task.sh"/>"
onclick="tjTask()">
</c:if>
<input type="button" name="delRow" value="<bean:message key="market.task.cent"/>"
onclick="back()">
</td>
</tr>
<!------------------------>
</td>
</table>
</html:form>
<jsp:include page="../../letter/mainEnd.jsp"></jsp:include>
</body>
</html>
<script type="text/javascript" language="javascript">
<c:if test="${tbMartTaskDetails!=null && !empty tbMartTaskDetails}" >
<c:forEach var="tbMartTaskDetail" items="${tbMartTaskDetails}" varStatus="status">
<c:choose>
<c:when test="${status.index==0}">
document.all.contents.value='<c:out value="${tbMartTaskDetail.content}"/>';
document.all.targets.value='<c:out value="${tbMartTaskDetail.target}"/>';
document.all.prompts.value='<fmt:formatDate value="${tbMartTaskDetail.prompt}" pattern="yyyy-MM-dd" />'
document.all.taskLevels.value='<c:out value="${tbMartTaskDetail.taskLevel}"/>';
document.all.assortUsers1.value='<c:out value="${tbMartTaskDetail.assortUser}"/>';
document.all.assortUsersN1.value='<c:out value="${assortUsersN0}"/>';
document.all.remarks.value='<c:out value="${tbMartTaskDetail.remark}"/>';
document.all.userIds.value='<c:out value="${tbMartTaskDetail.userId}"/>';
document.all.schedules.value='<c:out value="${tbMartTaskDetail.schedule}"/>';
document.all.evolves.value='<c:out value="${tbMartTaskDetail.evolve}"/>'
document.all.difficultys.value='<c:out value="${tbMartTaskDetail.difficulty}"/>';
document.all.scheduleNos.value='<c:out value="${tbMartTaskDetail.scheduleNo}"/>';
document.all.addPlaces.value='<c:out value="${tbMartTaskDetail.addPlace}"/>';
</c:when>
<c:otherwise>
<c:set var="n" value="${status.index}" scope="request" />
addRowWithContent(<c:out value="${status.index}"/>,'<c:out value="${tbMartTaskDetail.content}" />','<c:out value="${tbMartTaskDetail.target}" />',
'<fmt:formatDate value="${tbMartTaskDetail.prompt}"pattern="yyyy-MM-dd" />','<c:out value="${tbMartTaskDetail.taskLevel}" />' ,
'<c:out value="${tbMartTaskDetail.assortUser}" />','<c:out value="${tbMartTaskDetail.remark}" />',
'<c:out value="${tbMartTaskDetail.userId}" />','<c:out value="${tbMartTaskDetail.schedule}" />',
'<c:out value="${tbMartTaskDetail.difficulty}" />','<c:out value="${tbMartTaskDetail.scheduleNo}" />',
'<c:out value="${tbMartTaskDetail.addPlace}" />','<c:out value="${tbMartTaskDetail.evolve}"/>','<%=request.getAttribute("assortUsersN"+request.getAttribute("n"))%>');
</c:otherwise>
</c:choose>
</c:forEach>
</c:if>
</script>
发表评论
-
转 Jquery.Validate验证框架的使用说明
2013-11-23 09:33 926默认校验规则 (1)required ... -
jQuery Validation PlugIn的使用方法及样例
2011-01-27 14:10 1029一、用前必备 官方网站:http://bassistan ... -
域名转换(切换)的js代码
2009-03-30 12:43 1014可以将http://www.aaaa.com/aa/aa.ph ... -
一段AJAX代码
2008-09-23 10:57 1045<%@ page language="java ... -
表单全选(反选)
2007-08-15 10:22 1306//选中所有复选框 //form:复选框所属的form //o ... -
JS正则表达式的用法
2007-08-03 09:59 16011、“.”为通配符,表 ... -
javascript常用日期验证
2007-08-03 09:56 49691、 <script language=javascri ... -
经典正则表达式
2007-07-12 11:23 1013匹配中文字符的正则表达式: [\u4e00-\u9fa5] ... -
一个JS类(收藏)
2007-07-03 12:25 984prototype.js开发者手册 -
实现拖动(网上摘录-存档)
2007-07-03 09:45 890实现拖动code -
VBScript 调用webservice 示例
2007-07-03 09:37 1615<%@ include file="/WEB- ...
相关推荐
Jquery实现表格动态增加一行,删除一行(最简洁的代码实现)
在使用Layui进行数据展示时,经常需要动态地向数据表格添加新行。官方文档并没有提供直接实现该功能的API或示例代码,因此需要开发者自行实现。常见的方法是通过JavaScript或jQuery来操作DOM,向表格中添加新的`<tr>...
在.NET开发环境中,动态添加行是一项常见的需求,特别是在构建数据展示或者用户交互界面时。...配合图片资源“表格动态添加行.png”,可以更直观地理解这一过程。在实际项目中,可以根据具体需求调整和扩展这些方法。
这个例子中,当用户点击“添加行”按钮,会向表格末尾添加一个包含新数据的新行。同时,每个行中的“删除”按钮能够删除其所在行。 3. **优化与注意事项**: - 为避免多次绑定事件,使用事件委托,如`$('table')....
这将在表格的末尾添加一行,包含"数据1"和"数据2"。 为了使用户能够交互式地添加行,我们可能需要将此功能与按钮事件关联起来。例如,我们可以添加一个按钮,并在其点击事件中调用`addRow`: ```html (['新数据1',...
2. **TableRow**:TableLayout的子元素通常是TableRow,每个TableRow代表表格的一行。你可以向TableRow中添加各种视图,如TextView、ImageView等,来构建表格的单元格。 3. **动态添加视图**:在代码中动态创建并...
每一行可以包含多个`<td>`(单元格)或`<th>`(表头单元格)。在本例中,表格中可能还包含用于添加和删除行的按钮。 2. **jQuery选择器**:jQuery通过选择器来选取HTML元素,如`$("#id")`选择ID为特定值的元素,`$...
动态新增表格一行HTML页面源代码,用js实现的。
在XML布局文件中,你可以通过设置`<TableRow>`元素来创建表格行,然后在每一行中添加各种`View`对象,如`TextView`、`EditText`等。然而,对于动态添加,我们需要在代码中处理。 动态添加表格行的基本步骤如下: 1...
JavaScript(js)作为客户端脚本语言,使得我们能够实现表格的动态交互功能,如动态添加行、行编辑以及行数据修改。下面我们将深入探讨这些知识点。 ### 1. 动态添加行 在HTML中,`<table>`元素用于创建表格,但...
`TableLayout`是Android SDK中的一个视图组,它允许我们创建类似电子表格的布局,而`TableRow`则是`TableLayout`的子视图,用于表示表格的一行。在“android动态添加表格行.zip”中,我们可以找到一个名为`...
- `function add()` 函数被设计来向表格添加新行。当点击添加按钮时,此函数将被触发。 - `var tbl = document.all.ci;` 获取一个表格引用(假设通过某种方式,例如一个ID或者类选择器,已经被选中),记为`tbl`。 ...
在开发Web应用时,动态添加和删除表格行是常见的需求,尤其在数据管理或表单填写场景中。本文将深入探讨如何使用C#后端和JavaScript前端技术来实现这一功能,为初学者提供一个基础的实践指导。 首先,我们要了解...
要动态添加一行,首先需要获取到表格的引用,通常是通过`document.getElementById`或`document.querySelector`来实现。然后,创建一个新的`<tr>`元素,并为它添加需要的`<td>`子元素。最后,使用`appendChild`或`...
本文将深入探讨如何使用 jQuery 动态添加和删除表格行,以实现高效且用户友好的数据展示。 首先,理解 HTML 表格的基本结构至关重要。`<table>` 元素用于创建表格,`<tr>` 代表表格行,`<td>` 或 `<th>` 分别表示...
一个简单的表格由`<table>`元素开始,内部包含`<tr>`(表格行)元素,每一行里又包含`<td>`(表格数据单元格)或`<th>`(表头单元格)。例如: ```html 数据1 数据2 ``` 要使用jQuery动态添加行,我们可以...
在这个循环中,我们对每一行数据创建一个新的`TableRow`,然后遍历该行的数据,为每个单元格创建一个`TextView`并添加到当前行中。最后,将这行添加到`TableLayout`。 动态添加表格行时,还可以调整行和单元格的...
在上述代码中,`addRow`函数会在表格的末尾添加一行,而`deleteRow`函数则会删除最后一行。这些操作都是基于DOM(Document Object Model)进行的,可以直接改变HTML结构。 当然,为了使表格更具交互性,我们还可以...
5. **将表格添加到页面**:最后,将创建的表格添加到ASP.NET页面的HTML控件中,通常是`PlaceHolder`或`Panel`。 ```csharp PlaceHolder1.Controls.Add(table); ``` 在这个案例中,`Default.aspx`应该是ASP.NET的...