<a href='#' onclick="deleteById('commentTable',this)">${filterRemark}</a>
<a href="javascript:reject('${commentid}','${status}')">${relationid}</a>
$('#name').html(ret.name);
$('#createtime').html(formatDate(new Date(ret.createtime), "yyyy-MM-dd HH:mm:ss"));
$('#type').html(getTypeName(ret.type));
$('#status').html(getStatusName(ret.status));
$('#comments').html(ret.comments);
$('#filterRemark').html(ret.filterRemark);
$('#auditComment').html(ret.auditComment);
<input type="hidden" id="userId" name="userId" />
window.location.href = "../../auditmgr/tomeaudit/audit.html?type=comment&ids=" + id;
callUrl("snpCommentsFacade/removeSnpCommentsById.ssm", commentid);可以直接就与service打交道
if(confirm("点击确定将删除此评论?"))
var commentid = _para["commentid"];
if(commentid)
{
$('#commentid').val(commentid);
callSid('getCommentService', commentid);
}
formatDate(new Date(ret.createtime), "yyyy-MM-dd HH:mm:ss")
searchTableData('getSearchOriginList','$M.obj_snp','originTable');
/ \ \
service 对象 绑定的表格
<z:column id=col0 width="10%" caption="<a href='#' onclick='deleteSelected()'>删除所选</a>"
checkall="true" iskey="true" align="center">
<input type="checkbox" name='check' value='${creationid}' prop="creationid"/>
</z:column>
<a href='#' onclick="deleteById('originTable',this)">删除</a>
var pkey = $("#textContainer1").val(); ---->jquery获取值
if(!pkey || pkey.trim().length==0){
alert("关键词不能为空!");
return;
}
callSid('service1');--->在request中要绑定(参数)
onkeydown="checkMaxInput(this,70,'remLen')"
function selectMenu(oThis, tabID){ ---------->两个表格的切换
var oTags = document.getElementById("tabtr");
var oMenu = oTags.getElementsByTagName("td");
for(i = 0; i < oMenu.length; i++){
oMenu[i].className = "";
}
oThis.className = "on";
for(i = 0; i<2; i++){
document.getElementById("tab" + i).style.display = "none";
}
document.getElementById(tabID).style.display = "";
if(tabID=='tab0'){
callSid('initDeleteService');
}
if(tabID=='tab1'){
searchTableData('service0','[$M.contentFilterObj]','zteTable');
}
}
用来选择多表之间的跳转
document.getElementById("addBtn").style.display="none";
document.getElementById("updateBtn").style.display="";
----两个按钮,用来显示一个按钮
<input type="button" id="updateBtn" class="inputButton" onclick="updateContentFilter();" value=" 更 新 " style="display:none" />
//删除一条评论
function deleteById(tb, objects) ------------->对表格数据=删除
{
var objTable = getTableById(tb);
var tr = objects.parentNode.parentNode;
var index = tr.rowIndex;
var obj = objTable.data;
var commentid = obj[index - 1].commentid;
if(confirm("点击确定将删除此评论?"))
{
callUrl("snpCommentsFacade/removeSnpCommentsById.ssm", commentid);
deleteOneRow(tb, objects, false);
objTable.data.splice(index - 1, 1);
}
}
10.
var map = { newsTitle:newsTitle, typeId:typeId, firsttime:firsttime, lasttime:lasttime };
searchTableData('getSnpNewssService',map,'newsTable'); ------------>多条件查询map
11.获得时间:(target="lasttime")var firsttime = $('#firsttime').val();
var first = Date.parse(firsttime);
var last = Date.parse(lasttime);
<z:Calendar id="calendar1" target="lasttime" width ="20px"
imgurl="../../../uiloader/images/calendar.gif" formate='yyyy-MM-dd HH:mm:ss' ></z:Calendar>
$('#memberId').append("<a href='/viewMember.html?memberId='" + ret.memberId + ">" + ret.memberId + "</a>");
addOnloadEvent(init);
function init(){
var fundId = _para["fundId"];
callSid("getInvFundDetail",fundId);
}
function setValue(invFund){
//fundId、invLogoPath、attPath
var props=new Array(
'fundId','orgName','invDomain','invPhase','invSize',
'invIntroduction','invCase','invLogoPath','invWebsite','leader',
'contact','attPath','memberId','publicationDate','viewCount',
'auditUser','auditDate','auditComment');
for(var i=0;i<props.length;i++){
var propValue=eval("invFund."+props[i]);
$("#"+props[i]+"").html(propValue);
}
var st;
var st=new Array('0','1','2','3','4');
var stValue=new Array('草稿','待审核','审核通过','审核不通过','已作废');
for(var i=0;i<st.length;i++){
if(st[i]==invFund.status){
$("#status").html(stValue[i]);
return;
}
}
}
var url="audit.html?fundId="+fundId;
var vReturnValue =window.showModalDialog(url,'audit','dialogWidth:100%;dialogHeight:100%;help:no');
var table = getTableById("invTable");
table.refresh();
function getSelect(obj){
alert(obj.invDomain);
var str = obj.invDomain
var map = {};
map = {tzqy:"INV10001",tzly:str};
callSid("invDomainList",map);
}
#{'input:checked[name=score]'}.val(); --->用于判断选中的标签(jQuery)
19. 检查一段字符串是否全由数字组成
<script language="javascript"><!--
function checkNum(str){return str.match(/\D/)==null}
alert(checkNum("1232142141"))
alert(checkNum("123214214a1"))
// --></script>
20.移除属性: $("#"+props[i]+"").remove();
21.字符串拆分:
var summ=data.summary;
var i = summ.length/100;
if(i!=0) i=Math.floor(i+1);
var summa="";
if(summ.length>100)
{
for(var j=0;j<i;j++)
{
summa+=summ.substring((j+1)*100,100)+'<br/>';
}
}
alert(summa);
$("#summary").html(data.summary)
22.JS去空格:http://www.javaeye.com/topic/350056
function strTrim(str){
str = str.replace(/(^\s*)|(\s*$)/g, "");
return str;
}
23.用来遍历所有文本框
<html>
<head>
<script src="jquery-1[1].2.6.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".validate:text").each(function(){
if($(this).val() == '')
{
$(this).next().html("This field cannot be blank");
}
});
});
</script>
</head>
<body>
name:<input type="text" class="validate" size="10"/>
<span id="sampleText"></span>
</body>
</html>