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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:43:47+00:00 2026-06-01T06:43:47+00:00

I’d like to implement a multiselect function using jqGridRender (the php only version of

  • 0

I’d like to implement a multiselect function using jqGridRender (the php only version of jqGrid that uses javascript). Anyways i’m having troubles implementing it. I’ve found solution for javascript (and you can use javascript in predefinded function), which is here: http://www.trirand.com/blog/?page_id=393/help/multiselect-with-shift-to-emulate-the-same-behaviour-as-in-the-file-explorer/#p9963 I’m declaring this function as heredoc string ($myevent variable), and then call it under $gird->setGridEvent(‘onSelectRow’, $myevent); but it doesn’t work, here are the errors (but i’m not suer if they are the real cause):

Notice: Undefined variable: gird in C:\xampp\htdocs\kmedia\grid.php on line 72

Fatal error: Call to a member function setGridEvent() on a non-object in C:\xampp\htdocs\kmedia\grid.php on line 72

I’d also like to ask, how do i make cellEdit function, save the changes into variable, since when i’m setting grid options to cellEdit it works, but doesn’t save etc.

  • 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-01T06:43:49+00:00Added an answer on June 1, 2026 at 6:43 am

    You can use Oleg great suggestion from other answer (I modified it a bit):

    $.extend($.fn.jqGrid, {
        bindKeys: function (settings) {
            var o = $.extend({
                onEnter: null,
                onSpace: null,
                onLeftKey: null,
                onRightKey: null,
                scrollingRows: true
            }, settings || {});
            return this.each(function () {
                var $t = this;
                if (!$('body').is('[role]')) { $('body').attr('role', 'application'); }
                $t.p.scrollrows = o.scrollingRows;
                $($t).keydown(function (event) {
                    if (isInlineEdit()) {
                        return; // am if removed space etc does not work in inline edit
                    }
                    var target = $($t).find('tr[tabindex=0]')[0], id, r, mind,
                            expanded = $t.p.treeReader.expanded_field;
                    if (!target && $t.p.selrow !== null) {
                        r = $("#" + $t.p.selrow);
                        if (r.length > 0) {
                            target = r[0];
                        }
                    }
                    //check for arrow keys
                    if (target) {
                        mind = $t.p._index[target.id];
                        if (event.keyCode === 37 || event.keyCode === 38 || event.keyCode === 39 || event.keyCode === 40) {
                            // up key
                            if (event.keyCode === 38) {
                                r = target.previousSibling;
                                id = "";
                                if (r) {
                                    if ($(r).is(":hidden")) {
                                        while (r) {
                                            r = r.previousSibling;
                                            if (!$(r).is(":hidden") && $(r).hasClass('jqgrow')) { id = r.id; break; }
                                        }
                                    } else {
                                        id = r.id;
                                    }
                                }
                                if ($.inArray(id, $t.p.selarrrow) === -1) {
                                    if (!event.shiftKey) {// AM. added for shift+up arrow
                                        $($t).jqGrid('resetSelection');
                                        idsOfSelectedRows = []; // AM. Added
                                    }
                                    // todo: how to unselect row if shift is hold?
                                    // this only selectcts row
                                    $($t).jqGrid('setSelection', id);
                                    saveWindowState();
                                } else {
                                    $t.p.selrow = id;
                                }
                            }
                            //if key is down arrow
                            if (event.keyCode === 40) {
                                r = target.nextSibling;
                                id = "";
                                if (r) {
                                    if ($(r).is(":hidden")) {
                                        while (r) {
                                            r = r.nextSibling;
                                            if (!$(r).is(":hidden") && $(r).hasClass('jqgrow')) { id = r.id; break; }
                                        }
                                    } else {
                                        id = r.id;
                                    }
                                }
                                if ($.inArray(id, $t.p.selarrrow) === -1) {
                                    if (!event.shiftKey) {// AM. added for shift+up down arrow
                                        $($t).jqGrid('resetSelection'); // AM. added
                                        idsOfSelectedRows = [];
                                    }
                                    // todo: how to unselect row if shift is hold?
                                    // this only selectcts row
                                    $($t).jqGrid('setSelection', id);
                                    saveWindowState();
                                } else {
                                    $t.p.selrow = id;
                                }
                            }
                            // left
                            if (event.keyCode === 37) {
                                if ($t.p.treeGrid && $t.p.data[mind][expanded]) {
                                    $(target).find("div.treeclick").trigger('click');
                                }
                                if ($.isFunction(o.onLeftKey)) {
                                    o.onLeftKey.call($t, $t.p.selrow);
                                }
                            }
                            // right
                            if (event.keyCode === 39) {
                                if ($t.p.treeGrid && !$t.p.data[mind][expanded]) {
                                    $(target).find("div.treeclick").trigger('click');
                                }
                                if ($.isFunction(o.onRightKey)) {
                                    o.onRightKey.call($t, $t.p.selrow);
                                }
                            }
                            return false;
                        }
                        //check if enter was pressed on a grid or treegrid node
                        else if (event.keyCode === 13) {
                            if ($.isFunction(o.onEnter)) {
                                o.onEnter.call($t, $t.p.selrow);
                            }
                            return false;
                        } else if (event.keyCode === 32) {
                            if ($.isFunction(o.onSpace)) {
                                o.onSpace.call($t, $t.p.selrow);
                            }
                            return false;
                        }
                    }
                });
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post

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.