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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:14:35+00:00 2026-06-09T15:14:35+00:00

I have special implementation for my grid. For this I wrote some code in

  • 0

I have special implementation for my grid.
For this I wrote some code in onSelectRow and loadComplete methods of jqGrid.

In onSelectRow I need to update a global array and in loadComplete method I have to access the global array and need to some manupulation in jqGrid.

Till then I am okay. I’ve already done this.
Now I want to extend these two method in such a way that is implementation will be generic (other grid can use this without writing any code).

For that I thought of below steps.

  1. I want to add a new js (e.g: jquery.jqGrid.additional.js) in my html with jqGrid.js

  2. I want to assign my global variable by the data array of jqGrid

  3. In this js I want to check the value of multiselect of the grid

  4. If the value is true, then I want to extend onSelectRow, loadComplete methods in such way that jqGrid execute both my methods and the code written in onSelectRow, loadComplete methods also.

For example I have preLoadComplete and postLoadComplete which need to be executed just before and after loadComplete method execution. Similarly this hold true for onSelectRow method also.

I wrote below code in jquery.jqGrid.additional.js and then didn’t get the alert (1), alert (2) after jqGrid load.

It only execute the code written in loadComplete method of jqGrid.

var oldLoadComplete = $.fn.jqGrid.loadComplete;

$.jqGrid.extend({
   loadComplete: function (){
      var ret;
      // do someting before
      alert(1);

      ret = oldLoadComplete.call (this);

      // do something after
      alert(3);

      return ret; // return original or modified results
   }
});

I tried a lot with this and spent many hours.

  • 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-09T15:14:37+00:00Added an answer on June 9, 2026 at 3:14 pm

    You are trying to extend $.jqGrid, not $.fn.jqGrid. In the first line that would mean that $.jqGrid doesn’t even exist and that all elements would not have access to your modified .jqGrid plugin but still to the default.

    Though I tried to extend $.fn with a “new” append method did not work. You might have to overwrite those methods explicitly. I could imagine that jQuery has some safety routines for itself and plugins built in in the $.extend method.

    var oldLoadComplete = $.fn.jqGrid.loadComplete;
    
    $.fn.jqGrid.loadComplete = function( ) {
        alert('pre');
        var ret = oldLoadComplete.apply(this, arguments); // In case any arguments will be provided in future.
        alert('post');
        return ret;
    };
    

    Edit:

    Forget about all that. It is irrelevant. After looking into jqGrid’s source code on GitHub a little, it is obvious that jqGrid does not even use something like $.fn.jqGrid.loadComplete. That is something you made up yourself. Instead, it creates another object which provides a list of possible properties and defaults which then is overwritten by custom defaults and finally by the function parameter you pass in with your call to jqGrid.

    I found out that jqGrid triggers two events jqGridLoadComplete and jqGridAfterLoadComplete on your set of matched elements (i.e. this) before and after the call to the loadComplete callback respectively.

    So basically, you cannot use your attempt. Instead, the only solution that comes to my mind is to overwrite the jqGrid “constructor” (i.e. $.fn.jqGrid) using the same method and apply listeners to this like so:

    var oldJqGrid = $.fn.jqGrid;
    
    $.fn.jqGrid = function( ) {
        this.on('jqGridLoadComplete', function( jqEvt ) {
                alert('Pre');
            })
            .on('jqGridAfterLoadComplete', function( jqEvt ) {
                alert('Post');
            });
        return oldJqGrid.apply(this, arguments);
    };
    

    About your multiselect… I don’t know what you’re talking about. I have only very limited time myself and have to deny further assist for now.

    Sincerely.

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

Sidebar

Related Questions

I have some special parameters to all my wcf service methods that are handled
Does ** have any special meaning in C? Like this: static intparse_one (int argc,
There are some products for which I would like to have a special checkout
Say I have some special class, WrappedDataTable , and I want to associate each
I have a header file like this: /* * APP 180-2 ALG-254/258/772 implementation *
I have tried to use this code in VS2008 (and may have included too
I need to implement a special ZLib implementation which should run under .Net and
We have a project with some special requirements, one of wich is getting data
Is it possible to have special characters like åäö in the key? If i
I'm trying to query by iteration but our iteration names have special characters (e.g.

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.