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

The Archive Base Latest Questions

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

jqgrid advanced search dialog window size and position can changed by mouse. Those changes

  • 0

jqgrid advanced search dialog window size and position can changed by mouse.

Those changes are not remembered.
It is is opened next time, default size and position is shown.

How to save and restore it, probably using local storage.
Before resoring also check shoud be made that part of search dialog is visible if screen resolution or size has changed.

Update

I tried to extend Oleg answer to save / restore window position also using code below.
Search windows is restored to different positon than it was initially. It looks like left and top values retireved using code below are wrong. How to restore position also ?

var oldJqDnRstop, searchParams = { width: 550, left: 5, top: 5 };
if ($.jqDnR) {
    oldJqDnRstop = $.jqDnR.stop; // save original function
    $.jqDnR.stop = function (e) {
        var $dialog = $(e.target).parent(), dialogId = $dialog.attr("id");
        oldJqDnRstop.call(this, e); // call original function
        if (typeof dialogId === "string" && dialogId.substr(0, 14) === "searchmodfbox_") {
            // save the dialog position here
            // we save "width" option as the property of searchParams object
            // used as parameter of navGrid
            searchParams.width = $dialog.width();
            searchParams.left  = $dialog.offset().left;
            searchParams.top  = $dialog.offset().top;
            saveWindowState();
        }
    };
}

Update2

In Oleg demo, dialog header can moved outside of browser window. After that dialog is no more moveable. How to fix this ?

enter image description here

  • 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:19:11+00:00Added an answer on June 15, 2026 at 8:19 am

    I find your question interesting. So below you will find an possible implementation.

    One can divide your question in two parts: 1) saving of the width of the Searching Dialog during multiple opening in case of usage recreateFilter: true 2) saving the width inside of localStorage.

    The second part is relatively easy if you use localStorage already. You need just extend the saved state with one additional parameter. The exact implementation depend a little from the way how saving in localStorage are implemented. In the answer I shown how one can use getItem and setItem methods of window.localStorage to implement saving in localStorage. Alternatively one could use jStorage which is very practical if you need support old web browsers like IE6/IE7 additionally.

    So I explain below just how the width of the Searching Dialog can be saved during multiple opening in case of usage recreateFilter: true.

    I suggest to “subclass” the method $.jqDnR.stop because there are no callback which will be used at the end of dialog re-sizing. The corresponding code could be like below

    var oldJqDnRstop, searchParams = { width: 450 };
    
    if ($.jqDnR) {
        oldJqDnRstop = $.jqDnR.stop; // save original function
        $.jqDnR.stop = function (e) {
            var $dialog = $(e.target).parent(), dialogId = $dialog.attr("id");
            oldJqDnRstop.call(this, e); // call original function
            if (typeof dialogId === "string" && dialogId.substr(0,14) === "searchmodfbox_") {
                // save the dialog position here
                // we save "width" option as the property of searchParams object
                // used as parameter of navGrid
                searchParams.width = $dialog.width();
            }
        };
    }
    
    // create the grid
    $grid.jqGrid({
        ....
    });
    
    // create navigator with "Search" button where searchParams object
    // will be used as parameter
    $grid.jqGrid("navGrid", "#pager", {add: false, edit: false, del: false},
        {}, {}, {}, searchParams);
    

    You can see the corresponding demo here.

    UPDATED: To save position of the searching dialog together with the width one need to extend the code of new implementation of $.jqDnR.stop to the following

    $.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" && dialogId.substr(0,14) === "searchmodfbox_") {
            // save the dialog position here
            searchParams.width = $dialog.width();
            position = $dialog.position();
            searchParams.left = position.left;
            searchParams.top = position.top;
        }
    };
    

    In the above code the left and the top option will be additionally saved. The modified demo is here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Answer in how to enable enter in jqgrid advanced search window describes how to
If multiple grouping is used, jqgrid advanced search can generate search criteria like {groupOp:AND,rules:[],groups:[{groupOp:AND,rules:[{field:Nimi,op:cn,data:kk},{field:Nimi,op:cn,data:kkk}],groups:[]}]}
Pressing search button in jqgrid toolbar opens advanced search window. Pressing enter key does
Am curently looking at the jqgrid documentation on advanced search and specifically search_adv.php file
I am wondering if it is possible with JqGrid advanced search to display multiple
When I switched the jqGrid to use the advanced search - it seems to
I'm using the jqGrid plugin along with its 'advanced search' feature. Is there a
I wanna grid in jqGrid should vary its size dynamically depending on the window
I am using JQGrid Advance Search feature multipleSearch: true, multipleGroup: true . I am
With jqGrid if width of columns are not specified, they share the width of

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.