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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:45:25+00:00 2026-06-03T21:45:25+00:00

file location is: yiiroot/framework/widjets/assets/gridview/jquery.yiigridview.js I need to change one line in this file so

  • 0

file location is: yiiroot/framework/widjets/assets/gridview/jquery.yiigridview.js
I need to change one line in this file so that I can use it in my requirements.

//original code line 79,80
                if (settings.ajaxUpdate.length > 0) {
                    $(document).on('click.yiiGridView', settings.updateSelector, function () {

//I need to change it to :

                if (settings.ajaxUpdate.length > 0) {
                    $(this).parent().on('click.yiiGridView', settings.updateSelector, function () {

what is the right way to override this without needing to change the source code file?

  • 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-03T21:45:26+00:00Added an answer on June 3, 2026 at 9:45 pm

    An alternate method to do this would be to use jQuery’s off method.

    Using off you can remove the event handler that is already added in jquery.yiigridview.js, and then add a new handler using on.

    Something like this(in the view that has the grid view):

    <?php
    Yii::app()->clientScript->registerScript('myownhandlers',
        "
            $(document).off('click.yiiGridView', $.fn.yiiGridView.settings['your-grid-id'].updateSelector); // this will remove the jquery.yiigridview.js handler
    
            // assign the new handler, instead of $(this) you have to use the id of the element you are interested in
            $('#the-id-you-are-interested-in').parent().on('click.yiiGridView', settings.updateSelector, function () {
            // your function's code, you'll have to write your function
            });
        ",
        CClientScript::POS_LOAD // this is important because the default is POS_READY, and the gridview is available only after load
    );
    ?>
    

    Read on about the on method too to get a better understanding of the code.

    Note:

    Take care that the event namespace i.e click.yiiGridView is correct, actually in the version of yii i have there is no namespace and it is just click, so check that before overriding.

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

Sidebar

Related Questions

In the jQuery file itself: this.item_test = function(){ $('body').css('background-color', '#00ff00'); window.location = /allCorrect/yes; }
I have one file (location) that has an x,y coordinates and a date/time identification.
This is a code sample from Microsoft, with a different file location, that just
Need to lock the physical location file storage for the uploaded. On server, web
How do I change the file location? Now file is in news directory, how
I want to display thumbnail image in a gridview from file location. How to
I have a file location on my file system. I need to first load
So in one of my tables, there lies an image file location. I'm grabbing
I need to change the below code to pass a file to a django
I'm running the following code on a file that has been uploaded to this

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.