js

//点击启用
$(".status").on("click",function(){
var id = $(this).attr("statusId");
var customName = $(this).attr("customName");
var customStatus = $(this).attr("value");
var statusId = $(this).attr("statusId");
if(customStatus == 1){
strcustomStatus = "停用";
}else{
strcustomStatus = "启用";
}
alert(customStatus);
//alert(customName);
//alert(id);
ymPrompt.win({
width:260,
height:150,
icoCls: '',
message:'<div style="padding-top:25px;" class="message" align="center">您确定要'+strcustomStatus+'【'+customName+'】这个客户吗?</div>',
titleBar:false,
winPos:'c',
btn:[['OK','ok'],['Cancel','no']],
handler:function getButton(btn){
if(btn == "ok"){
$.ajax({
type:"Post",
data:{"customStatus":customStatus,"id":id},
dataType:"json",
url:classpath+"/updatecustomStatus",
success:function(data){
if(data.customStatus==1){
//点击
$("span[statusId='"+statusId+"']").val(1);
$("span[statusId='"+statusId+"']").html("<font color='red'>停用</font>");
$("#"+statusId+"").val(0);
$("#"+statusId+"").html("启用");
}else{
$("span[statusId='"+statusId+"']").val(0);
$("span[statusId='"+statusId+"']").html("启用");
$("#"+statusId+"").val(1);
$("#"+statusId+"").html("<font color='red'>停用</font>");
}
}
});
}
}
});

页面

    <s:form  id="form" method="post">
<table align="center" width="960" height="30" border="1px solid" id="find"/>
<tr align="center" cellpadding="0">
<th width="65px">序号</th>
<th width="220px">客户名称</th>
<th width="200px">法人代表</th>
<th width="180px">注册时间</th>
<th width="80px">类型</th>
<th width="80px">状态</th>
<th width="135px">操作</th>
</tr>
<s:iterator value="customsPageSupport.result" var="c" status="status">
<tr align="center">
<td>
<s:property value="#status.index+1"/>
</td>
<td><s:property value="customName"/></td>
<td><s:property value="bossName"/></td>
<td><s:date name="regDatetime" format="yyyy-MM-dd"/></td>
<td><s:property value="customTypeName"/></td>
<td>
<span id="${c.id}" style="color:green" firststatusId="${c.id }" value="${c.customStatus }"><s:if test="customStatus == 1">启用</s:if>
<font color="red"><s:else>停用</s:else></font></span>
</td>
<td>
<span style="cursor:pointer" class="find" findId="${c.id }" >查看</span>
<span style="cursor:pointer" class="update" updateId="${c.id }">修改</span>
<span id="secondspan" style="color:green;cursor:pointer" class="status" statusId="${c.id }" value="${c.customStatus }" customName="${c.customName }"><s:if test="customStatus == 0">启用</s:if>
<font color="red"><s:else>停用</s:else></font></span>
</td>
</tr>
</s:iterator>

ajax局部更新的更多相关文章

  1. ASP.Net Core使用Ajax局部更新

    由于目前ASP.NET Core中没有提供Ajax帮助器,所以参照 上一篇帖文,使用data-ajax-*属性来使用jQuery Unobtrusive Ajax功能实现HTML的局部页面元素更新. ...

  2. AJAX局部更新演出排期

    <script language="javascript" type="text/javascript"> function createXMLHt ...

  3. 【SSH网上商城项目实战28】使用Ajax技术局部更新商品数量和总价

         转自: https://blog.csdn.net/eson_15/article/details/51487323 昨天把项目部署了一下,玩了玩,今天完善了一下购物车中修改商品数量就能局部 ...

  4. winform 实现局部更新(如ajax实现)而整个界面不产生闪烁的解决方案

    转自原文winform 实现局部更新(如ajax实现)而整个界面不产生闪烁的解决方案 一.通过对窗体和控件使用双缓冲来减少图形闪烁(当绘制图片时出现闪烁时,使用双缓冲) 对于大多数应用程序,.NET ...

  5. .Net页面局部更新的思考

    最近在修改以前做的模块,添加一个新功能.整理了下才发现重用率很低,大部分的东西还是需要重新写.功能里用到了局部更新,所有整理一下一路来实现局部更新的解决方案及改进. 我接触的项目开发大多是以Asp.n ...

  6. ajax局部刷新

    //5秒刷新一次 $(function () { setInterval(Refresh, 5000); }); //ajax局部刷新 function Refresh() { $.ajax({ ty ...

  7. php Ajax 局部刷新

    php Ajax 局部刷新: HTML部分 </head> <body> <h1>Ajax动态显示时间</h1> <input type=&quo ...

  8. WebApiClient的JsonPatch局部更新

    1. 文章目的 随着WebApiClient的不断完善,越来越多开发者选择WebApiClient替换原生的HttpClient,本文将介绍使用WebApiClient来完成JsonPatch提交的新 ...

  9. 通过Solrj实现对索引库中数据的局部更新操作

    for (UpdateIndexDTO updateIndexDTO : data) { // 局部更新 SolrInputDocument doc = new SolrInputDocument() ...

随机推荐

  1. 网站如何启用SSL安全证书?IIS7启用新建Https:/

    网站使用SSL,通过SSL证书申请,然后导入之后.我们需要对网站进行设置才能正常使用SSL证书,具体如何操作让网站启用SSL呢,本经验以一个网站添加SSL主机头的方式为例来,网站启用SSL服务器安全证 ...

  2. An Introduction to Interactive Programming in Python (Part 1) -- Week 2_2 练习

    #Practice Exercises for Logic and Conditionals # Solve each of the practice exercises below. # 1.Wri ...

  3. Java获取客户端IP

    在开发工作中,我们常常需要获取客户端的IP.一般获取客户端的IP地址的方法是:request.getRemoteAddr();但是在通过了Apache,Squid等反向代理软件就不能获取到客户端的真实 ...

  4. Tomcat中部署后JspFactory报异常的解决方案

    The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory的异常的原因及解决办法原 ...

  5. 20145215《Java程序设计》课程总结

    20145215<Java程序设计>课程总结 每周读书笔记链接汇总 20145215<Java程序设计>第一周学习总结 20145215<Java程序设计>第二周学 ...

  6. 九幽史程博:助力国内开发者借Win10东风出海

    微软Biuld2016大会刚刚结束,会议上微软CEO纳德拉Show出的一大波黑科技,又一次让软粉们心情为之振奋,信仰充值爆棚! 尽管过去一年微软的Win10 Mobile表现不尽如人意,可是凭借PC端 ...

  7. 你的C#代码是怎么跑起来的(一)

    写了那么多C#代码,大家有没有想过自己写的代码编译后的可执行文件内部是什么样子,是怎样在系统上运行的? 编译成exe,然后双击exe文件运行,这中间到底发生了些什么呢,这篇先来剖析下exe内部的样子: ...

  8. 有四中方法可以实现PHP的伪静态,你造吗?

    说起伪静态的实现方案,你是不是很爽快的回答"简单,配置下apache的重写规则就行了嘛" 但是你有没有发现这种情况,你最近弄了很多新功能,每天上几个新功能,每天都有好多伪静态配置, ...

  9. jsp笔记

    Jsp  Web服务器访问jsp的过程. 如果是第一次访问jsp文件,web服务器会把jsp翻译成一个servlet文件.再将其编译成一个.class文件.然后加载到内存.蓝色的地方也是为什么jav ...

  10. java.io.stream

    1. package com.io.Stream; import java.io.*; public class NyFileInputStream1 { /** * 读取文件的streamIO * ...