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. [CareerCup] 2.3 Delete Node in a Linked List 删除链表的节点

    2.3 Implement an algorithm to delete a node in the middle of a singly linked list, given only access ...

  2. [CareerCup] 7.7 The Number with Only Prime Factors 只有质数因子的数字

    7.7 Design an algorithm to find the kth number such that the only prime factors are 3,5, and 7. 这道题跟 ...

  3. 《信息安全系统设计基础》实验五 简单嵌入式WEB服务器实验

    实验报告链接:http://www.cnblogs.com/lx20145332/p/6058790.html

  4. 【面试必备】Swift 面试题及其答案

    初级 问题1- Swift 1.0 or later 什么是optional类型,它是用来解决什么问题的? 答案:optional类型被用来表示任何类型的变量都可以表示缺少值.在Objective-C ...

  5. Opencv step by step - ROI

    什么是ROI?ROI就是region of interest ,就是你感兴趣的图像部分,在图像处理中,可能同时要处理多个ROI. Opencv有ROI的API,但是只能同时处理一个(书本上说的,未验证 ...

  6. ArrayList List<T> T[] Array

    ArrayList    其实就是一个存储obj列表的类 ArrayList 接受 null 作为有效值并且允许重复的元素. 不保证会对 ArrayList 排序. 在执行需要对 ArrayList ...

  7. ACL权限的学习

    ACL ACL:访问控制列表,其主要作用是将一些"用户"加到表中,并对这些用户的行为进行控制. 案例: 有个文件夹project是root用户创建,并且关于这个文件夹有以下权限 d ...

  8. PHP微信登錄(網頁授權)之後的獲取用戶的信息

    //這部峯代碼是封裝的庫文件,<?php /** * Created by PhpStorm. * User: root * Date: 16-6-23 * Time: 下午3:29 */ cl ...

  9. HTML上传文件写法

    来源于:http://www.cnblogs.com/SkySoot/p/3525139.html html 表单上传文件 一般处理程序由于没有 apsx 页面的整个模型和控件的创建周期,而比较有效率 ...

  10. [转]Java中的对象和对象引用实例浅析

    在Java中,有一组名词经常一起出现,它们就是“对象和对象引用”,很多朋友在初学Java的时候可能经常会混淆这2个概念,觉得它们是一回事,事实上则不然.今天我们就来一起了解一下对象和对象引用之间的区别 ...