How to redirect to own edit page instead of using inline edit when clicking the edit button in the toolbar.

May 1, 2014 at 5:29 PM
Hi,

I used most of the features in jqgrid. Really amazing. Thanks a lot.

Can you please let me know how to redirect new page when clicking edit.

Thanks,
Anbu
May 21, 2014 at 1:59 AM
You can not modify the default behavior of the Add and edit buttons but you can create your own and have them redirect to a URL. I do that on my site and here is the code I added to the jqGrid JavaScript to facility this
    .jqGrid( 'navButtonAdd', "#GridPager", {
        caption: "Add ",
        title: "Add New Item.",
        buttonicon: "ui-icon-add",
        onClickButton: function ()
            {
                location.assign( 'ADDURL' );
            }
        } )
        .jqGrid( 'navButtonAdd', "#GridPager", {
            caption: "Edit ",
            title: "Edit Selected Item.",
            buttionicon: "ui-icon-edit",
            onClickButton: function ()
            {
                var SelectedRow = $( '#Grid' ).jqGrid( 'getGridParam', 'selrow' );
                var CellValue = $( '#Grid' ).jqGrid( 'getCell', SelectedRow, 'ID' );
                location.assign( 'EDITURL?ID=' + CellValue );
            }
        } );