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. Runtime类及其常用方法

    每个 Java 应用程序都有一个 Runtime 类实例,使应用程序能够与其运行的环境相连接.可以通过 getRuntime 方法获取当前运行时. 常用方法: 1.public static Runt ...

  2. Java系列: JAVA字符串格式化-String.format()的使用(zz)

    常规类型的格式化 String类的format()方法用于创建格式化的字符串以及连接多个字符串对象.熟悉C语言的同学应该记得C语言的sprintf()方法,两者有类似之处.format()方法有两种重 ...

  3. vector 内存释放问题

    关于容器的处理,只是拿来用,理解不深,但是今天跑程序出了问题.释放空间未得到真正的释放.于是网上找了一些文章,解决的问题. 解决方法:使用swap 加上clear,一起释放空间. 原理:即先创建一个临 ...

  4. html 空格-有趣的试验

    首先,先给大家看一组demo <input /> <input type="submit" /> 展示效果: 为什么会出现空格呢?input不是行内元素吗? ...

  5. 16.C#初见Lambda表达式及表达式树(九章9.1-9.3)

    在说明Lambda相关知识前,我们需要了解Lambda表达式常用于LINQ,那么我们来聊下LINQ. LINQ的基本功能就是创建操作管道,以及这些操作需要的任何状态.这些操作表示了各种关于数据的逻辑: ...

  6. Linq之扩展方法

    目录 写在前面 系列文章 扩展方法 总结 写在前面 上篇文章介绍了隐式类型,自动属性,初始化器,匿名类的相关概念,及通过反编译的方式查看了编译器帮我们做了那些事.本篇文章将介绍扩展方法的知识点,及如何 ...

  7. Bootstrap3.0学习第十七轮(JavaScript插件——模态框)

    详情请查看http://aehyok.com/Blog/Detail/24.html 个人网站地址:aehyok.com QQ 技术群号:206058845,验证码为:aehyok 本文文章链接:ht ...

  8. 转-JS之Window对象

    一.说明:他是JS中最大的对象,它描述的是一个浏览器窗口,一般要引用他的属性和方法时,不需要用“Window.XXX”这种形式,而是直接使用“XXX”.一个框架页面也是一个窗口. 二.Window窗口 ...

  9. Java-LinkedHashSet

    如下: package 集合类.Set类; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedHash ...

  10. 判断Set里的元素是否重复、==、equals、hashCode方法研究-代码演示

    被测试类,没有重写hasCode()和equals()方法: package niukewang; import java.util.Objects; public class setClass { ...