jQuery UI Widgets Forums Grid selectionmode: 'checkbox' & selectAll

This topic contains 7 replies, has 3 voices, and was last updated by  Peter Stoev 10 years, 10 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • selectionmode: 'checkbox' & selectAll #50868

    assaf.frank123
    Participant

    Hi,
    I have a grid with selectionmode: ‘checkbox’.
    The problem is that after the grid rows are filtered and I press on the “selectAll” option
    all rows are actually selected (even those that are not visible) and so when I run:

    var rowindexes = $(‘#jqxgrid’).jqxGrid(‘getselectedrowindexes’);

    I get all indexes – while expecting to get only the visible rows indexes..

    Any solution for this?

    Thanks.

    selectionmode: 'checkbox' & selectAll #50873

    Peter Stoev
    Keymaster

    Hi assaf.frank123,

    You describe the default behavior which is by design. I am afraid that we cannot offer a different behavior.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    selectionmode: 'checkbox' & selectAll #50889

    assaf.frank123
    Participant

    Hi Peter,
    I think this is a faulty design.

    I a user’s perspective:
    I am working on your nice grid with filter options for the rows.
    I got from a 1000 rows table down to the 15 rows I am interested in – I wish to “select all” and perform an action on these…

    Unknowingly – the action is performed on all the records..

    This sounds like a bug in design.

    The selectAll is not usable for grids with filters..

    Please reconsider.

    Thanks.

    selectionmode: 'checkbox' & selectAll #50891

    Peter Stoev
    Keymaster

    Hi assaf.frank123,

    Ok, thank you for your opinion. I am sorry if it looks like a bug for you, but that is how we implemented the feature and it works in the way we implemented it. If you do not like that built-in behavior, you may use any of the other available selection modes.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    selectionmode: 'checkbox' & selectAll #50894

    assaf.frank123
    Participant

    Is there any way to get the visible row indexes then?

    I would loop over all selected rows and only if they are visible will the action be performed on it..

    Can –
    var rows = $(‘#jqxGrid’).jqxGrid(‘getdisplayrows’);

    help me?

    selectionmode: 'checkbox' & selectAll #50895

    Peter Stoev
    Keymaster

    Hi assaf.frank123,

    Yes, var rows = $(‘#jqxGrid’).jqxGrid(‘getdisplayrows’); will return only the visible set of rows. As pointed out in the API Documentation, you can get the bound index of each row. The bound index is the row’s index in the array returned by the “getboundrows” method.

    var boundIndex = rowdData.boundindex;
    

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    selectionmode: 'checkbox' & selectAll #51435

    computersarefun
    Participant

    Hi Peter,

    Thanks for your help. I am experiencing the same issue. I want to obtain a list of only the selected and visible rows when the user employs a filter. What is the best way to do this? I’m not sure what is meant by bound rows.

    I would also second Assaf’s opinion in that it might be better to change the selectall feature to only return visible rows, or perhaps create a parameter to the getselectedrowindexes method that only returns the visible ones.

    Thanks!

    David

    selectionmode: 'checkbox' & selectAll #51458

    Peter Stoev
    Keymaster

    Hi David,

    We do not plan to make any changes about jqxGrid for now. It is in stable state and only bug fixes are planned until Q3 2014.

    “getrows” returns the list of rows in the View i.e it takes into account the filtering, sorting, etc.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.