Emphasize the Jqgrid row when clicked on, but do not check the multiselect checkbox

Is there a method in jQgrid to highlight a row when clicked without selecting the multiselect checkbox?

I attempted using Multiboxonly = true as suggested by Oleg on

Your assistance would be greatly appreciated, as this issue is currently hindering progress on an important project.

Answer №1

It seems there may have been a typo in your input. You mentioned "Multiboxonly : true", but the correct implementation is actually "multiboxonly : true". This should function properly if you stick to the JavaScript-only version. If you are using a wrapper such as ASP.NET or PHP, be sure to refer to the documentation for guidance.

Warm regards

Answer №2

Here is my explanation on how to highlight a row when clicking without checking the checkbox - by using 'return false', we prevent onSelectRow from being triggered. PS: @tony, remember that 'multiboxonly' should be in lowercase.

beforeSelectRow: function (rowid, e) {
    //debugger;
    rowId = rowid;

    if ($("#jqg__tradesGrid_" + rowid).attr("disabled") || CommentsClicked) {
        CommentsClicked = false;
        return false;
    }

    if (e.target.type == "checkbox") {
        var blnChecked = $(e.target).is(":checked");
        var trElement = jQuery("#" + rowid, jQuery('#_tradesGrid'));

        if (!firstLoadWithRecords) {
            updateIdsOfSelectedRows(rowid, blnChecked);
        }

        if (blnChecked || $.inArray(rowid, idsOfSelectedRows) >= 0) {
            trElement.removeClass('ui-widget-content');
            trElement.addClass('ui-state-highlight');
        } else {
            trElement.removeClass('ui-widget-content');
            trElement.removeClass('ui-state-highlight');
        }

    } else {
        var blnChecked = $(e.target).is(":checked");
        var trElement = jQuery("#" + rowid, jQuery('#_tradesGrid'));

        trElement.removeClass('ui-widget-content');
        trElement.removeClass('ui-state-highlight');

    }


    //TODO: add style to change to silver when checkbox is checked
    CommentsClicked = false;
    return false;

},

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to eliminate the Iframe scrollbar while ensuring that the entire page loads?

When I add an Iframe inside the contentArea, two scroll bars appear. I am looking for a way to hide the iframe scrollbar without hiding any of the external website's content. I have tried using the scrollbar="no" snippet code, but it didn&ap ...

Is it possible to incorporate a combination of es5 and es2015 features in an AngularJS application?

In my workplace, we have a large AngularJS application written in ES5 that is scheduled for migration soon. Rather than jumping straight to a new JS framework like Angular 2+ or React, I am considering taking the first step by migrating the current app to ...

When the request's credentials mode is set to 'include', the 'Access-Control-Allow-Origin' header in the response should not be using the wildcard '*'

I am encountering an issue with my socket.io server as I am unable to connect to it from my local HTML file on my Mac. Error: Failed to load : The 'Access-Control-Allow-Origin' header in the response is causing a problem due to the wildcard ...

Steps to create a new window using Raphael JS

Is there a way to create a new window in Raphael similar to using "_blank"? ...

The error message "TypeError: dom.getElementsByTagName is not a function in Node.js" indicates

I have just started learning HTML and web development. I am trying to extract a list of tags from an HTML document but I keep receiving the error message TypeError: dom.getElementsByTagName is not a function. I am making a GET request using axios, then u ...

Can a YouTube video be triggered to play when a specific CSS style is selected?

I am searching for a method to display and play different YouTube videos based on a selected CSS style from a drop-down menu. I believe JavaScript can be utilized to detect the chosen CSS. Include the following in the html header of the page. <script ...

When using Next JS with StoryBook, an error may occur if styles are written in a module.scss file

Every time I try to add some styles to my ButtonWidget.scss file, I encounter an error in the console when running the command yarn storybook Error Code: ERROR in ./src/components/ButtonWidget/ButtonWidget.module.scss 1:0 Module parse failed: Unexpected ...

Modifying ID styling using JavaScript on Internet Explorer

I need to change the CSS display property from none to block using JavaScript, but only for Internet Explorer. My current code is not working for the ID #backfill-image. <script> function checkForIE() { var userAgent = navigator.userAgent; ...

Handling events for components that receive props from various components in a list

In my code, I have a component called PrivateReview which includes event handlers for updating its content. export default function PrivateReview(props) { const classes = useStyles(); const removeReviewAndReload = async () => { await ...

Menu Options in Material UI Navbar

I am currently working on incorporating an icon in my navbar that, when clicked, will reveal a dropdown list of notifications. Although I have come across several code examples for dropdown menus, none of them have completely assisted me or provided specif ...

"Facing an issue with Google Chrome not refreshing the latest options in an HTML select dropdown list

Having trouble creating an offline HTML file that incorporates jQuery for the script. The page features a state select menu followed by a second menu for counties. When a state is selected, only the corresponding counties should display while others remai ...

Utilizing Vue.js to compare two arrays and verify if the results are identical

I am in the process of developing a theater app that requires me to work with JSON data consisting of two arrays: Sections and Groups. While I have successfully loaded both arrays into my Vue app, I now need to compare them to find matches. The first array ...

using a ternary operator within the map function

Currently, I'm developing a web application that allows users to view a list of items and mark certain items as favorites. The favorites are stored in an array of IDs assigned to a prop (this.props.favorites). To ensure there are no duplicate entries, ...

Can you explain the functions of this "malicious" JavaScript code?

I came across this piece of code on a website that labeled it as "malicious" javascript. Given my limited knowledge of javascript and the potential risks involved in trying out the code on my own site, I was hoping someone here might be able to shed some l ...

Creating a personalized music player using an audio tag with HTML, CSS, and JavaScript

I am currently working on developing a unique music player from scratch without utilizing the "controls" tag within the audio element. My goal is to build something akin to the SCM Music Player. I've chosen not to use the SCM-provided player due to it ...

Exploring the depths of Cordova's capabilities: implementing a striking 3D front-to-back screen flip effect

Recently, I came across an interesting app that had a unique feature. By clicking on a button, the entire screen would flip from front to back with a 3D effect on iPhone. It was quite impressive to see in action. The developer mentioned that he achieved t ...

Notification of Leaf Name in d3.js

I am trying to display the leaf name when it is clicked, but I am unsure how to do it. I am new to D3 and would appreciate any guidance on how to achieve this. Source: http://bl.ocks.org/mbostock/7607535 var circle = svg.selectAll("circle") .data(nod ...

Setting the initial state for your ngrx store application is a crucial step in ensuring the

I'm completely new to ngrx and I'm currently exploring how to handle state management with it. In my application, each staff member (agent) is associated with a group of customers. I'm struggling to define the initial state for each agent ob ...

What steps should I follow to recreate this PHP hashing method in Node.js?

I am currently trying to replicate a password hashing algorithm in node.js (using LTS version 14.x) that was initially coded in PHP (version 7.2). Despite my efforts, the node.js implementation I have created seems to deviate from the original after the fi ...

jspdf generates blank PDF files

I am trying to use JsPDF to generate a PDF from content within a Section tag. I have followed various guides but none of them seem to be working for me. Since there is no demo code available, I am turning to this platform in hopes of finding a solution. A ...