zoukankan      html  css  js  c++  java
  • 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="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>&nbsp;&nbsp;
          <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();
     });

  • 相关阅读:
    as3的InteractivePNG例子
    HttpWebRequest模拟POST提交防止中文乱码
    net发布的dll方法和类显示注释信息(字段说明信息)[图解]
    IP地址、手机归属和身份证查询接口
    一些好用的开源控件
    c# 操作IIS应用程序池
    c# 获取电脑硬件信息通用查询类[测试通过]
    C# 操作线程的通用类[测试通过]
    几款浏览器JavaScript调试工具
    Microsoft SQL Server 2005 提供了一些工具来监控数据库
  • 原文地址:https://www.cnblogs.com/andydao/p/3160789.html
Copyright © 2011-2022 走看看