Html简单demo_html列表中进行编辑操作
html列表中进行编辑操作
<div class="_sort_box" style="float: left;"><?php echo $vo['remark'];?></div>
<div class="_sort_input_box" style="display:none; float: left;">
<input type="text" style="width:60px;" value="<?php echo $vo['remark'];?>" />
</div>
<div class="_edit_box" style="float: right;margin-right: 15px;">
<a class="_edit" href="javascript:void(0);" title="编辑客户备注">编辑</a>
</div>
<div class="_update_box" style="display:none;float: right;margin-right: 15px;">
<input name="plugin_id" type="hidden" value="<?php echo $vo['user']?>" />
<a class="_save" href="javascript:void(0);">保存</a>
<a class="_cancel" href="javascript:void(0);">取消</a>
</div>
//编辑
$('._edit').click(function(){
var tr = $(this).parents('tr');
tr.find('._sort_box').hide();
tr.find('._sort_input_box').show().find('input').val(tr.find('._sort_box').html());;
tr.find('._edit_box').hide();
tr.find('._update_box').show();
});
//保存
$('._save').click(function(){
if(window.flagReq == true)return;
var plugin_id = $(this).prev('input[name=plugin_id]').val();
var tr = $(this).parents('tr');
var sort = tr.find('._sort_input_box').find('input').val();
var url = "<?php echo url('User', 'updateRemark');?>";
window.flagReq = true;
$.post(url, {openId:plugin_id,remark:sort}, function(result) {
result = eval('('+result+')');
jsAlert(result.msg,function(){
if(result.error == 0){
tr.find('._sort_box').show().html(sort);
tr.find('._sort_input_box').hide();
tr.find('._edit_box').show();
tr.find('._update_box').hide();
}
window.flagReq = false;
});
});
});
//取消
$('._cancel').click(function(){
var tr = $(this).parents('tr');
tr.find('._sort_box').show();
tr.find('._sort_input_box').hide()
tr.find('._edit_box').show();
tr.find('._update_box').hide();
});
posted on 2013-06-28 14:31 andydaopeng 阅读(724) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)