html列表中进行编辑操作
//编辑
$('._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();
});