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 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 several common libs. Ideally we want them all to use the latest
I have a project where there are multiple applications that have some common configuration
The situation: We have a library project that houses much of our code for
I have a common code of serializing a class object in my 3-4 methods
With ASP.NET MVC, it is common to have AJAX code(e.g. jQuery) to invoke web
One of the most common dilemmas I have when commenting code is how to
I want to create templates for base new reports on to have common designs.
i have several common elements (components), that will generate some html. it seems my
We have a common problem of moving our development SQL 2005 database onto shared
I have a VB.NET application where various objects are going to access some common

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.