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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:17:06+00:00 2026-06-13T00:17:06+00:00

When implementing JQGrid 4.3.0, Jquery 1.6.2, and JQuery UI 1.8.16 Ive come across an

  • 0

When implementing JQGrid 4.3.0, Jquery 1.6.2, and JQuery UI 1.8.16 Ive come across an issue with the Inline edit. When the inline edit is activated, some of the elements get assigned an auto complete. When the inline edit is canceld or saved, the auto complete does not always go away (selecting text by double clicking it then hitting delete, then hitting escape to exit row edit). Leaving the auto complete controls in edit mode when the row is no longer considered in edit mode.

Perhaps you can tell me if there is a problem with the initialization or if I you are aware of an event post-“afterrestorefunc” that the fields can be returned to their “original” state. Original state being displayed as data in the JQGrid row.

I’ve tried removing the DOM after row close, .remove() and .empty():

 ... 
"afterrestorefunc": function(){ 
    $('.ui-autocomplete-input').remove();  }
...

but that causes other issues, such as the jqgrid is not able to find the cell when serializing the row for data or edit, and requires a refresh of the page, not just jqgrid, to be able to once again see the data from that row.

Auto complete functionality for the element is created on the double click of the row:

function CreateCustomSearchElement(value, options, selectiontype) {
...
            var el;
            el = document.createElement("input");
            ...
            $(el).autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: '<%=ResolveUrl("~/Services/AutoCompleteService.asmx/GetAutoCompleteResponse") %>',
                        data: "{ 'prefixText': '" + request.term + "', 'contextKey': '" + options.name + "'}",
                        dataType: "json",
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        success: function (data) {
                            response($.map(data.d, function (item) {
                                    return {
                                        label: Trim(item),
                                        value: Trim(item),
                                        searchVal: Trim(item)
                                    }

                            }))
                        }
                    });
                },
                select: function (e, item) {
                    //Select is on the event of selection where the value and label have already been determined.                        
                },
                minLength: 1,
                change: function (event, ui) {
                    //if the active element was not the search button                      
                    //...                       
                }
            }).keyup(function (e) {
                if (e.keyCode == 8 || e.keyCode == 46) {
                    //If the user hits backspace or delete, check the value of the textbox before setting the searchValue                
                    //...
                }
            }).keydown(function (e) {
                //if keycode is enter key and there is a value, you need to validate the data through select or change(onblur)
                if (e.keyCode == '13' && ($(el).val())) {
                    return false;
                }
                if (e.keyCode == '220') { return false }
            });
        }

Other Sources:
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing

http://api.jqueryui.com/autocomplete/

Update:
I tried only creating the autocomplete when the element was focused, and removing it when onblur. That did not resolve the issue either. It seems to just need the autocomplete dropdown to be triggered.

  • 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-13T00:17:07+00:00Added an answer on June 13, 2026 at 12:17 am

    I have a custom enable/disable function before the calling of the auto complete. This causes multiple reference calls to the same jqgrid cell causing conflict.
    So during my double click event on the row where it’s supposed to open up inline-editing. The row is taken and analyzed for what cells need to be enabled/disabled based on the record type it is. It determines the fields that are available by an associative array, serialized into a hidden field value, from the code behind during page load.

    function tableRowDoubleClick(id, iRow, iCol, e) {
    ...
    setCellEditabilityByRecordType(id);
    ...    
    }
    

    The Cell editability is set by the following way:

     function setCellEditabilityByRecordType(id) {
    //change some of the fields to read-only
    var grid = $('#mygrid');
    var i;
    var cm;
    var cellRecordType = grid.jqGrid('getCell', id, 'RecordType')
    //Determine Fields Disabled by evaluation of data from a hidden field.
    var disablefields = eval(pg_FieldDisable[cellRecordType]);
    for (i = 0; i < disablefields.length; i++) {
    cm = grid.jqGrid('getColProp', disablefields[i]);
    cm.editable = false;
    }
    ...
    }
    ...
    

    So when the initial setup of the row reacts to being double clicked, the cell editability is set. Then the “CreateCustomSearchElement” triggers.

    However if the user double clicks on the row, it triggers the double click again, setting the cell editability, but for the same row. So this causes multiple references to the cell that, at this point, I’m not sure what’s happening. All I know is I have to centralize the row editability to one function or find a way to read if the current row that was double clicked really needs the editability set again.

    References
    JavaScript Assocaitive Arrays: http://blog.xkoder.com/2008/07/10/javascript-associative-arrays-demystified/

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

Sidebar

Related Questions

Implementing a custom VM and I've come to use registers (these will store pointers
When implementing an object using ArrayAccess or ArrayObject , to some operations it's a
i am using jqgrid with codeigniter. i am implementing inlinenav using following snippet. here
I had a question before about implementing datepicker with jqgrid. I think that question
I am implementing JQGrid and sending the datatype as JSON. Also, I've set loadonce
Implementing the very first scala example I ran into some problems probably tipical for
I just took a look at jqgrid . Has anyone tried implementing this plugin,
Implementing a custom Dependency Property on a Framework Element object causes my Visual Studio
Implementing the ScriptControlClass was extremely easy, unfortunately the side effects with the language implementation
implementing publishActivity in PHP using the REST API using this code: $activity = array(

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.