Preventing the opening of a form on a add button click

前端 未结 2 972
伪装坚强ぢ
伪装坚强ぢ 2021-01-16 17:26

Did you guys know how to prevent the open of a Form when I click on a add button?

Maybe using beforeShowForm?

function(formid)
{
    if(jQuery(\'#gri         


        
2条回答
  •  借酒劲吻你
    2021-01-16 17:59

    Cool, tks Oleg!!! BTW, I came with another(but not beautifull) solution:

    ** This is a aftershowform action. If we do not have a selected row on the main grid(#gridap), we hide the form modal with jqmHide(). Then, I use your solution to show the alertcap.

    
    $closeform = <<< CLOSEF
    function(formid)
    {
        if(!jQuery('#gridap').getGridParam('selrow'))
        {
            $('#editmodgridbal').jqmHide();
            viewModal('#alertmod', { gbox: '#gbox_', jqm: true });
        }
    }
    CLOSEF;

    $grid->setNavEvent('add','afterShowForm',$closeform);

提交回复
热议问题