[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。

[备忘]easyUI的window真是垃圾~~

上一篇:[备忘]easyUI的window访问两次后台url
下一篇:[备忘]mybatis报错,attempted to return null from a method with a primitive return type (int)

添加日期:2015/9/1 11:42:07 快速返回   返回列表 阅读2888次
垃圾,window的内容实际是插入到原来的页面的dom中的,

比如子页面用了一个datagrid,那么每次都插入一个到子页面中,

由于id相同,就会出现取不到选中值,选中值下次还记得,等各种的奇怪问题。

烦死~~

又不想用js写~~

所以干脆,每次用一个新id,爱咋咋的~~

原来是这样:


<table id="dgInvalid" class="easyui-datagrid" title="请选择需要作废的发票"
    style="width: 100%; height: 200px"
    data-options="rownumbers:true,
    singleSelect:false,
    url:'${ctx}/invoiceHandel/getValidList?orderCode=${orderCode}',
    method:'get',
    pagination:false,
    onLoadSuccess:function(data){xxx(data)}">
    <thead>
        <tr>
            <th data-options="field:'id',checkbox:true"></th>
            <th data-options="field:'invoicehead',width:80">发票抬头</th>
            <th data-options="field:'invoicemakedate',width:100">开票日期</th>
            <th data-options="field:'invoicetype',width:80">发票类型</th>
            <th data-options="field:'invoiceamount',width:80,align:'right'">发票金额</th>
            <th data-options="field:'safeamount',width:220">保险金额</th>
            <th data-options="field:'linkman',width:60">联系人</th>
            <th data-options="field:'phone',width:60">电话</th>
            <th data-options="field:'address'">地址</th>
        </tr>
    </thead>
</table>
    <script>

    function xxx(data) {
         $('#dgInvalid').datagrid('clearChecked');
          alert(111);
    } 
</script>


还打算,每次载入数据,清空选择呢,呵呵,
里面有好几个grid,能tm好使嘛~~

修改后:


<table id="dgInvalid_${gridId}" class="easyui-datagrid" title="请选择需要作废的发票"
        style="width: 100%; height: 200px"
        data-options="rownumbers:true,
        singleSelect:false,
        url:'${ctx}/invoiceHandel/getValidList?orderCode=${orderCode}',
        method:'get',
        pagination:false>
        <thead>
            <tr>
                <th data-options="field:'id',checkbox:true"></th>
                <th data-options="field:'invoicehead',width:80">发票抬头</th>
                <th data-options="field:'invoicemakedate',width:100">开票日期</th>
                <th data-options="field:'invoicetype',width:80">发票类型</th>
                <th data-options="field:'invoiceamount',width:80,align:'right'">发票金额</th>
                <th data-options="field:'safeamount',width:220">保险金额</th>
                <th data-options="field:'linkman',width:60">联系人</th>
                <th data-options="field:'phone',width:60">电话</th>
                <th data-options="field:'address'">地址</th>
            </tr>
        </thead>
    </table>


后台生成一个gridId,用时间等随机数字即可。
 

评论 COMMENTS
没有评论 No Comments.

添加评论 Add new comment.
昵称 Name:
评论内容 Comment:
验证码(不区分大小写)
Validation Code:
(not case sensitive)
看不清?点这里换一张!(Change it here!)
 
评论由管理员查看后才能显示。the comment will be showed after it is checked by admin.
CopyRight © 心缘地方 2005-2999. All Rights Reserved