0

Within jQgrid is there a way that a row can be clicked on and then highlighted without the multiselect row checkbox being checked?

I have tried with Multiboxonly = true which was recommended by Oleg https://stackoverflow.com/a/3719637/853607

Any help would be great as this is stopping progress on a critical project.

Community
  • 1
  • 1

2 Answers2

0

Maybe you have typed it wrong. You speak Multiboxonly : true, but actuually it is multiboxonly : true in the implementation. This should work if you use JavaScript only version. If you use some wrapper like ASP.NEt or PHP you should consult the docs for these.

Kind Regards

Tony Tomov
  • 3,122
  • 1
  • 11
  • 18
0

Here is my answer for clicking on a row and not checking the checkbox but the row getting highlighted - returning false ensures onSelectRow is not fired. ps @tony I had multiboxonly in lower case.

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: put in the style to chagne to silver when the checkbox is checked
    CommentsClicked = false;
    return false;

},