jQuery UI Widgets Forums Grid Row Select Event not working properly in selectionmode "none"

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 9 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • abhishekkkk
    Participant

    Hi ,
    I am using jqxgrid licensed version 3.6 for my application .Here,I want to select one row at a time in the grid.However,I cant use the “singleselect” selection mode as I have some links in grid cells on which a popup opens up.So,if I make the selection mode as “singleselect”,the user will have to select the row first and then he can click on any link to open the popup.(This will require 2 clicks which will increase user’s effort)

    So,to implement both the functionalities ,I am using selectionmode as ‘none’ along with below code on rowselect.However,the issue is that the row is not getting selected on the very first select for the first time.After that it is working as expected.
    Can anyone please look into this and suggest what I am missing in this code?

    $(“#jqxgrid”).jqxGrid(

    {
    width: ‘100%’,
    columnsresize: true,
    autoheight: true,
    pageable: true,
    editable: true,
    selectionmode: ‘none’,
    autoheight: true,
    rowsheight:40,
    showfilterrow: true,
    filterable : true,
    sortable : true,
    columns: [
    { text: ”, columntype: ‘checkbox’, datafield: ‘available’, filterable : false , width: ‘2%’, showfilterrow: false,pinned:true},
    { text: ‘List ID’, datafield: ‘groupId’,filtertype : ‘textbox’,width: ‘6%’, cellsalign: ‘left’ , editable: false},
    { text: ‘List Name’, datafield: ‘groupName’, filtertype : ‘textbox’, width: ‘17%’ ,cellsalign: ‘left’,editable: false,},
    { text: ‘List Description’, datafield: ‘groupDescription’, filtertype : ‘textbox’, width: ‘22%’,cellsalign: ‘left’,editable: false },
    { text: ‘Shared’, datafield: ‘sharedWithCount’, filtertype : ‘textbox’,filtercondition :’equal’, width: ‘7%’, cellsrenderer: cellsrendererSharedCount, cellsalign: ‘left’ , editable: false},
    { text: ‘Created by’, datafield: ‘fullName’, filtertype : ‘textbox’, width: ‘14%’, cellsalign: ‘left’, editable: false,cellsrenderer: cellsrenderer},
    { text: ‘Modified by’, datafield: ‘rowCreator’, filtertype : ‘textbox’, width: ‘14%’,cellsalign: ‘left’ ,editable: false,cellsrenderer: cellsrendererRowModified},
    {text: ‘Last Modified’, datafield: ‘rowUpdatedDate’, filtertype : ‘textbox’,cellsalign: ‘left’,editable: false},

    ],

    });
    $(“#jqxgrid”).bind(‘rowselect’, function (event) {

    var rows = $(“#jqxgrid”).jqxGrid(‘selectedrowindexes’);
    var wanted=rows[rows.length – 1];

    for (var m = 0; m < rows.length; m++) {
    var row = $(“#jqxgrid”).jqxGrid(‘getrowdata’, rows[m]);
    var selectedrowindex = rows[rows.length – m – 1];

    if(selectedrowindex !=wanted ){
    $(“#jqxgrid”).jqxGrid(‘unselectrow’, selectedrowindex);
    $(“#jqxgrid”).jqxGrid(‘setcellvalue’, selectedrowindex, ‘available’, false);
    }

    else{
    $(“#jqxgrid”).jqxGrid(‘selectrow’, selectedrowindex);
    $(“#jqxgrid”).jqxGrid(‘setcellvalue’, selectedrowindex, ‘available’, true);
    }
    }

    });


    Dimitar
    Participant

    Hi abhishekkkk,

    When selectionmode is set to ‘none’, the rowselect event will not be triggered when you click the row, but the rowclick event will. We suggest you use it instead.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.