jQuery UI Widgets Forums Grid grid selectrow method also unselect a selected row!

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

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

  • reblutus
    Blocked

    I just realized that the selectrow method un-select an already selected row. It acts in fact like a trigger. This is not a welcome behaviour.

    The unselectrow method does not select the row if it is already unselected why the opposite is true for the selectrow method.

    Maybe I do something wrong? Here is a sample of my code

    	function selectDisplayedRows(){
    var $songsGrid = $("#songsGrid");
    var displayedRows = $songsGrid.jqxGrid("getdisplayrows");
    if(songs.length == displayedRows.length){
    $songsGrid.jqxGrid('selectallrows');
    $songsGrid.trigger("rowselect");
    }else{
    $songsGrid.jqxGrid('beginupdate');
    for(rowIndex in displayedRows){
    $songsGrid.jqxGrid('unselectrow', displayedRows[rowIndex].dataindex); // needed to make sure the row is "trully" unselected
    $songsGrid.jqxGrid('selectrow', displayedRows[rowIndex].dataindex);
    }
    $songsGrid.jqxGrid('endupdate');
    $songsGrid.jqxGrid('refresh');
    }
    }

    Dimitar
    Participant

    Hello reblutus,

    This behaviour occurs only when the selectionmode property is set to “multiplerows”, allowing the user to select and unselect a row with a mouse click. When the selectionmode is either “singlerow”, “multiplerowsextended” or “multiplerowsadvanced”, the selectrow method does not unselect selected rows. You can see the differences in selectionmodes in the demo Row Selection.

    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.