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

  • Home
  • SEARCH
  • 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 6475941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:45:54+00:00 2026-05-25T06:45:54+00:00

I have common code that I want in various events for our standard jqGrid

  • 0

I have common code that I want in various events for our standard jqGrid configuration.

I use $.extend($.jgrid.defaults, { }); to set some code for the following:

  • loadError()
  • beforeRequest()
  • loadComplete()
  • gridComplete()

Now, when I define an instance of my grid, there is a potential that I would like to execute more code in any of these events.

My initial solution was to have global variables, e.g.: loadCompleteEx() and if they are defined, call them at the end of the default method calls. This was great if I only had one grid on the page, but I am trying to implement a solution that would work regardless of how many grids are on the page.

Is there some way to hook in and add a method to execute when any of these events are fired? I’m using jqGrid 4.1.2 and jQuery 1.6.

Thanks in advance for your help!

  • 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-25T06:45:55+00:00Added an answer on May 25, 2026 at 6:45 am

    You can .bind() your own functions to events, so that your function executes with the event. You could use this to bind different events to each grid, or bind one function to every grid at once.

    .bind() also allows binding to standard javascript events, custom events, or even undefined strings which you later call with .trigger().

    It needs to be attached after a selector, which can select a specific grid or multiple grids in your case.

    $('#Your-Grid-Selector').bind('eventToBind', functiontoBind() {
                alert('Triggered eventToBind');
            });
    

    jQuery Documentation

    Edit: This question may be a duplicate of this SO Question, which has a good solution you can use for this very issue.

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

Sidebar

Related Questions

We have a repository of common code on svn that we use for many
Quick question about include/requre_once . I have some code that is common to a
I have a common comms library that i have written to communicate with our
The situation: We have a library project that houses much of our code for
We have a team of 40+ engineers working on a common code base. We're
I have several ASP.NET websites in a solution along with a common C# code
I have code like this: public bool Set(IEnumerable<WhiteForest.Common.Entities.Projections.RequestProjection> requests) { var documentSession = _documentStore.OpenSession();
I have the following code in python from selenium import webdriver from selenium.webdriver.common.by import
I have common functionality that I need to access from all screens of my
I have a controller that stores various info (Ie. FormID, QuestionAnswerList, etc). Currently I

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.