`
焱下川
  • 浏览: 22208 次
  • 性别: Icon_minigender_1
  • 来自: 南京
最近访客 更多访客>>
社区版块
存档分类
最新评论

js加表格和dwr调用

DWR 
阅读更多
function callback(data){
	document.getElementById(openSpan).innerHTML=data;
    oldOpenSpan=openSpan;
}
function showInnerInfo(marketing_activity_id)
{   
    openSpan =marketing_activity_id;
	if(""!=document.getElementById(openSpan).innerHTML){
 	      document.getElementById(openSpan).innerHTML="";
 	     document.getElementById('img_'+marketing_activity_id).src="<%=path %>/images/16_16/foldr_16.gif";
        oldOpenSpan="";
	}else if(openSpan!=oldOpenSpan){  
	   document.getElementById('img_'+marketing_activity_id).src="<%=path %>/images/16_16/open_16.gif";
	  showWellenService.getWellenList(marketing_activity_id,callback);
    }
}
function addrows(marketing_activity_id)
{
    if(document.form1.marketing_activity_name==null)
    {
    var id = document.getElementById("tb_"+marketing_activity_id);
    var tr = id.insertRow(id.rows.length);
    var td;
    td = tr.insertCell();
    td.align = "center";
    td.innerHTML = "<input type='text' name='marketing_activity_name' size='15'>";
    td = tr.insertCell();
    td.align = "center";
    td.innerHTML = "<input type='text' name='marketing_activity_desc' size='35'>";
    td = tr.insertCell();
    td.align = "center";
    td.innerHTML = "&nbsp;";
    td = tr.insertCell();
    td.align = "center";
    td.innerHTML = "&nbsp;";
    td = tr.insertCell();
    td.align = "center";
    td.innerHTML = "&nbsp;";
    td = tr.insertCell();
    td.align = "center";
    td.innerHTML = "&nbsp;";
    td = tr.insertCell();
    td.align = "center";
    td.innerHTML = '<a href="#" onclick="saveInfo('+marketing_activity_id+')"/>[保存]</a>'
                  +'<a href="#" onclick="rntInfo('+marketing_activity_id+')"/>[取消]</a>';
	  }
   
}
function saveInfo(id)
{
  var name = document.form1.marketing_activity_name.value;
  var desc = document.form1.marketing_activity_desc.value;
  var cert_name = '${name}';
  showWellenService.insertList(id,name,desc,cert_name,callback);
  
}
function editInfo(w_id,a_id)
{ 
    if(document.form1.marketing_activity_name==null)
   {
   var tr_id = document.getElementById(w_id);
   tr_id.cells[0].align="center";
   tr_id.cells[0].innerHTML = "<input type='text' name='marketing_activity_name' size='15'>";
   tr_id.cells[1].innerHTML = "<input type='text' name='marketing_activity_desc' size='35'>";
   tr_id.cells[6].innerHTML = '<a href="#" onclick="updateInfo('+w_id+','+a_id+')"/>[保存]</a>'
                                 +'<a href="#" onclick="rntInfo('+a_id+')"/>[取消]</a>';
   }
   
}
function updateInfo(w_id,a_id)
{
  
  var name = document.form1.marketing_activity_name.value;
  var desc = document.form1.marketing_activity_desc.value;
  var cert_name = '${name}';
  openSpan =a_id;
  showWellenService.updateList(a_id,w_id,name,desc,cert_name,callback);
}
function deleteInfo(w_id,a_id)
{
  
  var r=confirm("确认删除?");
   if(r==true)
   {
  openSpan =a_id;
  showWellenService.deleteList(a_id,w_id,callback);
  }
}
function rntInfo(marketing_activity_id)
{
  openSpan =marketing_activity_id;
   showWellenService.getWellenList(marketing_activity_id,callback);
}
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics