Jquery easyUI dialog的close和destroy

之前在用easyUI的时候遇到一个问题,一直困扰着我。

问题:

使用dialog来实现保存和编辑框,使用dialog.(“close”)来关闭dialog框,这个时候如果有两个页面的保存页面的表单的字段相同时,这两个表单的东西就会混乱。要不就是保存时打不开,要不就是编辑页面打开数据初始化不了。

解决思路:

使用close的方法来关闭dialog时,此dialog并不是完全消失,只是隐藏起来了而已。当另外一个dialog和这个dialog相同时,就会发生混乱。所以我们不适用close的方法来关闭dialog,使用destroy来销毁dialog,当使用destroy时,如果页面上显式定义了dialog的话,关闭后就永远都打不开了。所以我们不显式定义dialog,并且把保存页面和列表页面分开。

解决代码如下:

list.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.ourpalm.resupgrade.bean.GmMenu"%>
<%@ page import="com.ourpalm.resupgrade.bean.GmModule"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<html>
<head>
<%
    String path = request.getContextPath();
    request.setAttribute("path", path);
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="resourceUploadGM" />title>
<link rel="stylesheet" type="text/css"
    href="<%=path%>/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/themes/icon.css">
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js">script>
<script type="text/javascript" src="<%=path%>/js/jquery.easyui.min.js">script>
<fmt:setLocale value="${local}" />
<fmt:setBundle basename="applicationMessage" />
head>
<body>
    <table id="dgResource" class="easyui-datagrid" fit="true" url=""
        toolbar="#toolbar" pagination="true" rownumbers="true"
        fitColumns="true" singleSelect="true" pageSize="15"
        pageList="[15,20,25,30,35]">
        <thead>
            <tr>
                <th data-options="field:'id',width:20,align:'center'">idth>
                <th data-options="field:'resourcePath',width:40,align:'center'"><fmt:message
                        key="resourceFileName" />th>
            tr>
        thead>
        <tr>tr>
    table>
    <div id="toolbar" style="padding: 5px; height: auto">
        <div style="margin-bottom: 5px">
            <a href="javascript:void(0)" class="easyui-linkbutton"
                iconCls="icon-add" plain="true" onclick="newResource()"><fmt:message
                    key="add" />a> <a href="javascript:void(0)"
                class="easyui-linkbutton" iconCls="icon-edit" plain="true"
                onclick="editResource()"><fmt:message key="edit" />a> <a
                href="javascript:void(0)" class="easyui-linkbutton"
                iconCls="icon-remove" plain="true" onclick="destroyResource()"><fmt:message
                    key="delete" />a> <a href="javascript:void(0)"
                class="easyui-linkbutton" iconCls="icon-remove" plain="true"
                onclick="UpdateResourceBeansProduced()"><fmt:message
                    key="flushcatch" />a>
        div>
    div>
    <script type="text/javascript">
        $("#dgResource").datagrid({
            url : "${path}/resourceServlet.do?method=search&fromFlg=lodad"
        });
        function editResource() {
            var row = $('#dgResource').datagrid('getSelected');
            if (row) {
                $('
'
).dialog({ id : 'newDialog', title : 'My Dialog', width : 800, height : 600, closed : false, cache : false, href : '${path}/view/gmtool/resource_save.jsp', modal : true, onLoad : function() { //初始化表单数据 }, onClose : function() { $(this).dialog('destroy'); }, buttons : [ { text : 'OK', iconCls : 'icon-ok', handler : function() { //提交表单 } }, { text : 'CANCEL', iconCls : 'icon-cancel', handler : function() { $("#newDialog").dialog('destroy'); } } ], }); } }
script> body> html>

save.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.ourpalm.resupgrade.bean.GmMenu"%>
<%@ page import="com.ourpalm.resupgrade.bean.GmModule"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<html>
<head>
<%
    String path = request.getContextPath();
    request.setAttribute("path", path);
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="resourceUploadGM" />title>
<link rel="stylesheet" type="text/css" href="<%=path%>/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/themes/icon.css">
<script type="text/javascript" src="<%=path%>/js/jquery-1.8.0.min.js">script>
<script type="text/javascript" src="<%=path%>/js/jquery.easyui.min.js">script>
<fmt:setLocale value="${local}" />
<fmt:setBundle basename="applicationMessage" />
head>
<body>
    <div class="ftitle">
        <fmt:message key="resourceinformation" />
    div>
    <form id="fmResource" method="post" novalidate>
        <div style="display: none;">
            <input name="id" id="id" value="">
        div>
        <div class="fitem">
            <label class="rightalign"><fmt:message key="resourceFileName" />:label>
            <input name="resourcePath" id="resourcePath"
                class="easyui-validatebox" required="true">
        div>
    form>
    <script type="text/javascript">
    script>
body>
html>

英语笔记14:big、bag、small、long、short、tall的形象和含义

big的形象和含义:

单词big [biɡ]的含义是大。

形象分析:

b表示躯体。我们介绍b字母的时候说过b字母的原型是树,由树的含义延伸为躯体的含义:树——树干——躯体。

i表示细小的物品。

g表示长。

所以,big描述的形象是:细小的物品躯体长大。本来是表示动作,后来主要用来表示长大后的状态,变成形容词。

bag的形象和含义:

那单词bag [bæg] n. 袋 的含义又如何理解呢?

a表示大的物品。大的物品还能再涨大吗?如果能,会出现什么状况?答案是变成空心的,变成可以装物品的袋子。

small的形象和含义:

small的含义是小、少。

形象分析:

s表示收缩。S的形象和本义是弯曲,弯曲的形象也就是收缩的形象,所以s的含义可以延伸为收缩。

m表示多。

a表大块的物品。

ll的形象是两条直线,平行线,表示距离。

所以,small的形象是收缩多个物块之间的距离。

理论上说,理想物体的体积是不能被压缩的,能压缩的只是其组成物质之间的距离。海绵被压缩后体积变小,不是纤维的体积变小了,而是因为纤维之间的空间缩小了。一团沙子被捏成一团后体积变小,不是沙粒的体积变小了,而是沙粒和沙粒之间的距离变小了。物体的体积在低温下收缩变小了,不是物体的分子体积变小了,而是因为低温下分子之间的斥力减少,分子之间的距离变小了。所以,物品整体体积收缩,本质上是组成成分间的距离收缩了。

small描述的正是这种变化。本来应该是动词,但和big一样,最后多用作形容词。表示小,后延伸为少。少,是数量值小的意思。

因为big和small本义中描述的都是变化过程。所以,big中的元音字母为表示小的i,变化前的体积相对变化后的体积是小的,小的物体才能变大。small中的元音字母是表示大的a,变化前的体积相对变化后的体积是大的,大的物体才能变小。

long的形象和含义:

long的含义是长。

形象分析

L表示直线、长,长条状的物品。

o表示球形。

n表示隆高。

g表示起。

Long的形象,像是和面时向上拉起面团的样子。当然,古人可能拉的是泥巴。球形的面团,本来各方向宽度都一致,拉起来后就变成了长条状。

Short的形象和含义:

Short的含义是短、矮。

形象分析:

S收缩

H表示高度尺,表示高度。也有可能指由上向下压的手。

O球形物品。

R表示分叉。

Or表示散开。

T表示凸出。

Short所描述的形象是,球形物受到上方的压力,高度方向收缩,向四周分散凸出去。和面和玩过泥巴的人应该有体会。所以short的含义是缩短,常用作形容词表示短的状态。短也就是矮,我们中文根据方向不同,细分为短和矮,但英文里是不分的,统一用short表示。

Long和short所描述的形象也都是物体尺寸的变化,含义延伸表示变化后的状态。所以不管变长还是变短,都用表示球形的元音o。球形,方向宽度都相等,所以有拉长就变成长形物和缩短后变成形状短的物品。

tall的形象和含义:

t表示凸。

a表示物。不需要强调物体形状,且用在重读音节中的元音,一般都用a。

ll:两条平行线,表示距离。

Tall的形象表示物品凸出(地面、桌面等)的距离,也就是相对地面或桌面等基准面的高度。

表示高的词根alt,所表达的形象也是和tall一样。

big、small、long、short、tall的发音和形象的关系:

从发音的口型来说,

big的发音,由bi的小口型过渡到g的大口型,符合由小到大的形象。

Small的发音,口型是始终不大的,符合小的含义和形象。

long和tall的发音是延长的,符合长、高的含义。

Short的发音是收缩的,短促的,符合短的含义。

本站内容来自用户投稿,如果侵犯了您的权利,请与我们联系删除。联系邮箱:835971066@qq.com

本文链接:http://news.xiuzhanwang.com/post/1260.html

友情链接: