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 8927055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:08:02+00:00 2026-06-15T08:08:02+00:00

How to create jqgrid edit form at specified position and size which can changed

  • 0

How to create jqgrid edit form at specified position and size which can changed in runtime?
Edit window postition should combined with other edit parameters in navGrid.

I tried code below but alert box does not appear and edit form is shown in default position.

var oldJqDnRstop,
  editWindowParams = { 
          left: 10,
          width: window.innerWidth-18,
          top: 5,
          height: 100
          };

if ($.jqDnR) {
    oldJqDnRstop = $.jqDnR.stop; // save original function
    $.jqDnR.stop = function (e) {
        var $dialog = $(e.target).parent(), dialogId = $dialog.attr("id"), position;
        oldJqDnRstop.call(this, e); // call original function
        if (typeof dialogId !== "string") {
            return;
        }
        if (dialogId.substr(0, 11) === "editmodgrid") {
            editWindowParams.width = $dialog.width();
            position = $dialog.position();
            editWindowParams.left = position.left;
            editWindowParams.top = position.top;
        }
    };
}


        $.extend($.jgrid.edit, {
          closeAfterAdd: true,
          recreateForm: true,
          reloadAfterSubmit: false,
          left: 10,
          dataheight: '100%',
          width: window.innerWidth-18
        });



     $grid.jqGrid("navGrid", "#grid_toppager", { edit: true }, 
      { 
       top: function() { alert(editWindowParams.top); return editWindowParams.top; },
       left: function() { return editWindowParams.left; },
       width: function() { return editWindowParams.width; },
       height: function() { return editWindowParams.height; },

            afterSubmit: function (response, postdata) { 
              if (response.responseText.charAt(0) === '{') {
                var json = $.parseJSON(response.responseText);
                return [true, '', json.Id];
                }
              alert( decodeErrorMessage(response.responseText, '', ''));
              return [false, decodeErrorMessage(response.responseText, '', ''), null];
              },

            beforeShowForm: function ($form) {
              $("#tr_Info>td:eq(1)").attr("colspan", "2"); 
              $("#tr_Info>td:eq(1)>textarea").css("width", "95%"); 
              $("#tr_Info>td:eq(0)").hide(); 
              $("#tr_Markused>td:eq(1)").attr("colspan", "2"); 
              $("#tr_Markused>td:eq(1)>textarea").css("width", "95%"); 
              $("#tr_Markused>td:eq(0)").hide(); 
              beforeShowForm_base($form);
              },


            url: '/Edit',
            closeAfterEdit: true,
            onClose: function(){ 
              $( ".ui-autocomplete-input").trigger("blur");
            } 

       } );
  • 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-06-15T08:08:04+00:00Added an answer on June 15, 2026 at 8:08 am

    The demo demonstrate the fixed code. It’s modification of the demo from my previous answer. It uses the following code:

    if ($.jqDnR) {
        oldJqDnRstop = $.jqDnR.stop; // save original function
        $.jqDnR.stop = function (e) {
            var $dialog = $(e.target).parent(), dialogId = $dialog.attr("id"),
                position, $form;
    
            oldJqDnRstop.call(this, e); // call original function
            if (typeof dialogId === "string") {
                if (dialogId.substr(0,14) === "searchmodfbox_") {
                    // save the dialog position here
                    searchParams.width = $dialog.width();
                    position = $dialog.position();
                    searchParams.left = Math.max(0, position.left);
                    searchParams.top = Math.max(0, position.top);
                } else if (dialogId.substr(0,7) === "editmod") {
                    // Add or Edit form
                    editParams.width = $dialog.width();
                    position = $dialog.position();
                    editParams.left = Math.max(0, position.left);
                    editParams.top = Math.max(0, position.top);
                    $form = $dialog.find("form.FormGrid");
                    if ($form.length > 0) {
                        editParams.dataheight = $form.height();
                    }
                    editParams.height = $dialog.height();
                } else if (dialogId.substr(0,6) === "delmod") {
                    // Delete form
                }
            }
        };
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have create the the jqgrid which loads the data from the server ,
Simple question: How can one close ajqgrid edit form? I close dialog boxes with
I have customized jqGrid's edit form to have some fields that use jQuery's DatePicker
I am using jqgrid Modal form to Add and Edit rows of the table.
hopefully this is a simple question. In the JQGrid form edit mode, the edit
I can see how to create a jqGrid link using: colModel: [ {name:'myname', formatter:'showlink',
i'm starter in jqgrid, i write this code for create and fill jqgrid(i'm use
I'm trying to build a system using jqgrid which does everything on the clientside,
how can I set a css class to the element jqgrid creates by using
I have a single page application which create and remove a number of iframe

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.