Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6137333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:42:45+00:00 2026-05-23T17:42:45+00:00

I have created JQGrid with Jquery modal dialog for Delete. Jqgrid with inline editing

  • 0

I have created JQGrid with Jquery modal dialog for Delete. Jqgrid with inline editing and one field is required if i leave it blank and the press submit the it will popup message Please enter First Name but the problem is Inbuilt Popup message and my jquery modal dialog are looking too different.

Inbuilt JQGrid Modal Dialog:
enter image description here

JQuery Modal Dialog
enter image description here

CODE:

function createGrid() {
        jQuery("#list").jqGrid({
            url: '@Url.Action("JQGridGetGridData", "TabMaster")',
            datatype: 'json',
            mtype: 'GET',
            colNames: ['col ID', 'First Name', 'Last Name', ''],
            colModel: [{ name: 'colID', index: 'colID', width: 100, align: 'left', searchoptions: { sopt: ['eq', 'ne', 'cn']} },
                      { name: 'FirstName', index: 'FirstName', width: 150, align: 'left', editable: true, editrules: { required: true} },
                      { name: 'LastName', index: 'LastName', width: 150, align: 'left', editable: true, editrules: { required: true} },
                      { name: 'act', index: 'act', width: 60, sortable: false}],
            pager: jQuery('#pager'),
            hidegrid: false,
            rowNum: 100,
            rowList: [10, 50, 100, 150],
            sortname: 'colID',
            sortorder: "asc",
            viewrecords: true,
            multiselect: false,
            width: 500,
            height: "250px",
            imgpath: '@Url.Content("~/Scripts/themes/steel/images")',
            caption: 'Tab Master Information',
            editurl: '@Url.Action("JQGridEdit", "TabMaster")',
            gridComplete: function () {
                var ids = jQuery("#list").getDataIDs();
                for (var i = 0; i < ids.length; i++) {
                    var id = ids[i];
                    be = "<a href='#'><div title='Edit' id='action_edit_" + id + "' class='actionEdit' onclick='inlineEdit(" + id + ");'></div></a>";
                    de = "<a href='#'><div title='Delete' id='action_delete_" + id + "' class='actionDelete' onclick='inlineDelete(" + id + ");'></div></a>";
                    se = "<a href='#'><div title='Save' style='display:none' id='action_save_" + id + "' class='actionSave' onclick='inlineSave(" + id + ");'></div></a>";
                    ce = "<a href='#'><div title='Cancel' style='display:none' id='action_cancel_" + id + "' class='actionCancel' onclick='inlineCancel(" + id + ");'></div></a>";
                    jQuery("#list").setRowData(ids[i], { act: be + de + se + ce })
                }
            }
        }).navGrid('#pager', { edit: false, add: false, del: false, search: false, refresh: false });
    }

How can i apply Jquery Modal Dialog for JQGrid inbuilt dialog skin?

Thanks,
Imdadhusen

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:42:45+00:00Added an answer on May 23, 2026 at 5:42 pm

    jqGrid is jQuery plugin and not a jQuery UI widget. So it use not jQuery UI dialog. Instead of that it uses $.jgrid.createModal, $.jgrid.viewModal and $.jgrid.hideModal method. In some situation simplified version $.jgrid.info_dialog are used. Many people (inclusive me) wish that jqGrid in one of the next version will do use more jQuery UI controls internally and probably will be a jQuery UI widget, but now if you want to create dialog in jqGrid style you should use the methods which I listed above.

    As an example of usage of the functions I suggest the following example which create the same dialog as jqGrid do with delGridRow method. I included in the demo the “Delete” navigation button to show, that if you first use “Delete selected row” button which create dialog and then use “Delete” navigation button no new dialog will be created by jqGrid. Instead of that our custom dialog will be used.

    The corresponding code is below:

    var grid = $("#list"),
        gID = grid[0].id, //grid[0].p.id,
        IDs = {
            themodal:'delmod'+gID,
            modalhead:'delhd'+gID,
            modalcontent:'delcnt'+gID,
            scrollelm:'DelTbl_'+gID
        },
        hideDialog = function() {
            $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:true, onClose: null});
        },
        rowId,
        createDeleteDialog = function() {
            var dlgContent =
                "<div id='"+IDs.scrollelm+"' class='formdata' style='width: 100%; overflow: auto; position: relative; height: auto;'>"+
                    "<table class='DelTable'>"+
                        "<tbody>"+
                            "<tr id='DelError' style='display: none'>"+
                                "<td class='ui-state-error'></td>"+
                            "</tr>"+
                            "<tr id='DelData' style='display: none'>"+
                                "<td>"+rowId+"</td>"+ // it has not so much sense
                            "</tr>"+
                            "<tr>"+
                                "<td class='delmsg' style='white-space: pre;'>"+$.jgrid.del.msg+"</td>"+
                            "</tr>"+
                            "<tr>"+
                                "<td>&#160;</td>"+
                            "</tr>"+
                        "</tbody>"+
                    "</table>"+
                "</div>"+
                "<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+IDs.scrollelm+"_2'>"+
                    "<tbody>"+
                        "<tr>"+
                            "<td>"+
                                "<hr class='ui-widget-content' style='margin: 1px' />"+
                            "</td>"+
                        "</tr>"+
                        "<tr>"+
                            "<td class='DelButton EditButton'>"+
                                "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>Delete</a>"+
                                "&#160;<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>Cancel</a>"+
                            "</td>"+
                        "</tr>"+
                    "</tbody>"+
                "</table>";
    
            if ($('#'+IDs.themodal).length===0) {
                // dialog not yet exist. we need create it.
                $.jgrid.createModal(
                    IDs,
                    dlgContent,
                    {
                        gbox: "#gbox_"+gID,
                        caption: $.jgrid.del.caption,
                        jqModal: true,
                        left: 12,
                        top: 44,
                        overlay: 10,
                        width: 240,
                        height: 'auto',
                        zIndex: 950,
                        drag: true,
                        resize: true,
                        closeOnEscape: true,
                        onClose: null
                    },
                    "#gview_"+gID,
                    $("#gview_"+gID)[0]);
                $("#dData","#"+IDs.scrollelm+"_2").click(function(){
                    // "Delete" button is clicked
                    var rowId = grid.jqGrid('getGridParam', 'selrow');
                    grid.jqGrid('delRowData',rowId);
                    //$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:true, onClose: null});
                    hideDialog();
                });
                $("#eData", "#"+IDs.scrollelm+"_2").click(function(){
                    // "Cancel" button is clicked
                    //$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:true, onClose: null});
                    hideDialog();
                    //return false;
                });
            }
    
            $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:true, overlay: 10, modal:false});
        };
    
    grid.jqGrid({/*jqGrid options*/});
    
    $("#delgridrow").click(function() {
        rowId = grid.jqGrid('getGridParam', 'selrow');
        if (rowId === null) {
            $.jgrid.viewModal("#alertmod",{gbox:"#gbox_"+grid[0].p.id,jqm:true});
            $("#jqg_alrt").focus();
        } else {
            createDeleteDialog();
        }
    
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom dialog for Visual Studio Setup Project using the steps
I am looking to drag a row from the jqGrid I have created and
I'm developing a page where i need to show a jqGrid with inline editing
I have jqgrid and in that I have one custom navigation button to export
have you ever created any custom action on your jqGrid? looking at this example
I'm using jqgrid with inline editing , when the user gets to the last
Using jquery's jqGrid plugin, I have it setup to do sorting, paging, and searching.
I have a dynamically created jqGrid with a custom formatter. I need to be
I have this code just to send data from already loaded jqGrid: jQuery(#bedata).click(function(){ //Function
I have a code for jqGrid with custom editFunc that opens my own jQuery-UI

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.