简体   繁体   English

带有提交按钮的Jqgrid信息对话框

[英]Jqgrid info dialog with submit button

I am using the below code to create a info dialog with submit button.This is working well. 我正在使用下面的代码创建带有提交按钮的信息对话框。 Now i want to do some action while i click the submit button. 现在,我想在单击“提交”按钮时执行一些操作。 This is not working while i use the onSubmit : function(){}. 当我使用onSubmit:function(){}时,这不起作用。 I used onClose means its working. 我使用onClose表示其正常工作。 Please help me to do this. 请帮我做到这一点。 sorry for my english.. 对不起我的英语不好..

var totalSelect = "";
$.jgrid.info_dialog("Select Deny Function(s) to Map", selOptin + "</ul>", $.jgrid.edit.bSubmit, {
    zIndex: 1500,
    width: gwdth,
    align: 'left',
    height: 'auto',
    onSubmit: function () {
    alert('enter hgere');
$('input[name="FunctionCheckbox"]:checked').each(function () {
    totalSelect = totalSelect + this.value + ",";
    });
    element.value = totalSelect.slice(0, -1);
    return true;
    }
    });

i found following way to create buttons and properly deal with their click event 我发现以下创建按钮并正确处理其点击事件的方法

var dialog=$.jgrid.info_dialog("Caption","text","", { 
    zIndex: 1500,
    buttons:[{
        text:"Submit", 
        id:"but_submit",  onClick:function(b) { 
            alert("submit button clicked");
        }
    }, {
        text:"Cancel", 
        id:"but_cancel", 
        onClick:function(b) {
            alert("cancel button clicked");
        }
    }]
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM