<script type="text/javascript">
      <!-- js -->

/*======================================================================删除功能(2)*/
	function deletex() {
		var row = $("#dg").datagrid('getSelected');
		if (row) {
		 var  id=row.id;
		   url="xxx/xxx/delete.do?id="+id;
		   /* 打开删除弹框 */
			$("#dlg_delete").dialog("open").dialog("setTitle", "删除!");

		} else {
		   url="";
			$.messager.alert('系统提示', '请选择要删除的记录!', 'error');
		}
	}
	/*---------------------------------------------------------------------删除功能实现  */
	function deleteing(){
	        $("#fm_delete").form("submit",{
	           url: url,
	           onSubmit : function() {
			   },
	           success:function(result){
	             var result=eval('(' + result + ')');
	             if(result.success){
	               $("#dlg_delete").dialog("close");
					$("#dg").datagrid("reload");
	             }
	             else{
	             }
	               $.messager.show({
	                  title : "系统提示",
					  msg : result.msg
	                }
	             );
	         }
	      }
	    );
	}
	</script>

<div id="toolbar_tb">
		<!-- 工具栏 -->
		<a href="javascript(0)" class="easyui-linkbutton"
				iconCls="icon-remove" plain="true" onclick="deletex();">删除</a>
		</div>
		<!-- 删除弹框 -->
		<div id="dlg_delete" class="easyui-dialog"
			style="width: 300px; height: 200px; padding: 10px 20px" closed="true"
			buttons="#dlg_del_buttons">
			<form id="fm_delete" method="post" novalidate>
				<label>
					确定删除吗?
				</label>
			</form>
		</div>
		<!-- 确认删除  与 取消删除 -->
		<div id="dlg_del_buttons">
			<a href="javascript(0)" class="easyui-linkbutton"
			 	iconCls="icon-remove" onclick="deleteing();">删除</a>
			<a href="javascript(0)" class="easyui-linkbutton"
				iconCls="icon-cancel" onclick="javascript:$('#dlg_delete').dialog('close');">取消</a>
		</div>

  

05-17 08:45