欢迎来到天天文库
浏览记录
ID:37180987
大小:25.50 KB
页数:4页
时间:2019-05-21
《easyui增删改查代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、
2、uihelpyoubuildyourwebpageeasily!">
3、el="stylesheet"type="text/css"href="http://www.jeasyui.com/easyui/demo/demo.css">#fm{margin:0;padding:10px30px;}.ftitle{font-size:14px;font-weight:bold;color:#666;padding:5px0;margin-bottom:10px;border-bottom:1pxsolid#ccc;}.fitem{margin-bott
4、om:5px;}.fitemlabel{display:inline-block;width:80px;}5、script">varurl;functionnewUser(){$('#dlg').dialog('open').dialog('setTitle','NewUser');$('#fm').form('clear');url='save_user.php';}functioneditUser(){varrow=$('#dg').datagrid('getSelected');if(row){$('#dlg').dialog('open').dialog('setTitle','EditUser');$('#fm').f6、orm('load',row);url='update_user.php?id='+row.id;}}functionsaveUser(){$('#fm').form('submit',{url:url,onSubmit:function(){return$(this).form('validate');},success:function(result){varresult=eval('('+result+')');if(result.success){$('#dlg').dialog('close');//close7、thedialog$('#dg').datagrid('reload');//reloadtheuserdata}else{$.messager.show({title:'Error',msg:result.msg});}}});}functionremoveUser(){varrow=$('#dg').datagrid('getSelected');if(row){$.messager.confirm('Confirm','Areyousureyouwanttoremovethisuser?',function(r){8、if(r){$.post('remove_user.php',{id:row.id},function(result){if(result.success){$('#dg').datagrid('reload');//reloadtheuserdata}else{$.messager.show({//showerro
5、script">varurl;functionnewUser(){$('#dlg').dialog('open').dialog('setTitle','NewUser');$('#fm').form('clear');url='save_user.php';}functioneditUser(){varrow=$('#dg').datagrid('getSelected');if(row){$('#dlg').dialog('open').dialog('setTitle','EditUser');$('#fm').f
6、orm('load',row);url='update_user.php?id='+row.id;}}functionsaveUser(){$('#fm').form('submit',{url:url,onSubmit:function(){return$(this).form('validate');},success:function(result){varresult=eval('('+result+')');if(result.success){$('#dlg').dialog('close');//close
7、thedialog$('#dg').datagrid('reload');//reloadtheuserdata}else{$.messager.show({title:'Error',msg:result.msg});}}});}functionremoveUser(){varrow=$('#dg').datagrid('getSelected');if(row){$.messager.confirm('Confirm','Areyousureyouwanttoremovethisuser?',function(r){
8、if(r){$.post('remove_user.php',{id:row.id},function(result){if(result.success){$('#dg').datagrid('reload');//reloadtheuserdata}else{$.messager.show({//showerro
此文档下载收益归作者所有