--通常在表格增删改的情况下使用
m_pGrid = CLuaGridUtil();
m_pGrid:SetGrid(ui:getDialogName(),'id_grid');
m_help = CSelectHelp();

function main()
    local sql = [[select * from uums_user with(nolock) where is_delete = 0]]
    if db:select(sql,'',m_help) < 0 then
        return ui:tip(db:error());
    end
    m_pGrid:setHelp(m_help);
end

function confirm_close()
    local help = CSelectHelp();
    m_pGrid:getHelp(help);
    if m_help:toString() ~= help:toString() then
        if not ui:msgConfirm('修改未保存,是否关闭窗口?') then
            ui:setClose(false);--取消关闭窗口
        end
    end
end

main();

ui:setCloseScript('confirm_close();');
Copyright © TouchNet 2015 all right reserved,powered by Gitbook最后修订时间: 2022-06-21 09:21:04

results matching ""

    No results matching ""