jQuery MiniUI

 找回密码
 立即注册
查看: 1193|回复: 1
打印 上一主题 下一主题

mini-grid如何实现关联校验 [复制链接]

Rank: 8Rank: 8

楼主
发表于 2022-9-19 09:12:00 |显示全部楼层
<div field="a" name="aa" width="120" headerAlign="center" allowSort="true">a
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div>  
            <div field="b"  width="120" headerAlign="center" allowSort="true">b
                <input property="editor" class="mini-textbox" style="width:100%;" />
            </div>

function onCellValidation(e) {
           
            if (e.field == "a") {
                if (e.record.b == 1) {

                } else {
                    e.isValid = false;
                    e.errorText = "不能为空";
                }
            }
            if (e.field == "b") {
                grid.validateCell(e.record, "aa");     
            }
        }b列验证完主动去验证同行a列。

Rank: 8Rank: 8

沙发
发表于 2022-9-20 10:19:20 |显示全部楼层
哎呀 发表于 2022-9-19 18:02
a单元格onCellValidation时,grid.validateCell(e.record, "bb");  
b单元格onCellValidation时,grid.va ...

Archiver|普加软件

GMT+8, 2024-6-16 09:54 , Processed in 1.070117 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部