JqGrid Edit & Delete button with each row

2019-04-17 10:07发布

问题:

i m using jqgrid with mvc 3, I want to add Edit and Delete button with every row of JqGrid , i have achieved this thing by the help of this link. But it is for inline editing, i want to open a popup widows when click on edit button.

How can i achieve this thing.

Thanks

回答1:

You should just use new editformbutton: true option which exists starting with version 4.1.0 of jqGrid:

formatter:'actions',
formatoptions: {
    keys: true,
    editformbutton: true
}


回答2:

Please find the colmodel below for editing:

 {
                    name: 'EditAction',
                    width: 60,
                    fixed: true,
                    search: false,
                    sortable: false,
                    resize: false,
                    formatter: 'actions',
                    formatoptions: {
                        keys: false,
                        editbutton: true,
                        delbutton: false,
                        editformbutton: false,
                        onSuccess: function(response) {
                            if (response.status == 200) {
                            }
                        },
                        extraparam: { oper: 'edit' },
                        url: '@Url.Action("ActionName", "Controller")'
                    }
                },