Would it be possible to add a setting to display the number of items that were grouped?

Would it be possible to add a setting to display the number of items that were grouped?

paulobocpauloboc Posts: 12Questions: 0Answers: 0

just like in the attached screenshot

Replies

  • kthorngrenkthorngren Posts: 22,299Questions: 26Answers: 5,127

    Not sure what your screenshot is showing. Is this using RowGroup? If yes then use rowGroup startRender or rowGroup.endRender, similar to this example. If this doesn't help then please provide more details of what you are using. Maybe post your Datatables init code so we can see your config.

    Kevin

  • paulobocpauloboc Posts: 12Questions: 0Answers: 0
    edited September 30

    I don’t use rowGroup, I’m using ColumnControl - this is my configuration.

    columnControl: [
    'search',
    'order',
    [
    'searchList',
    {
    extend: 'dropdown',
    content: ['colVis'],
    },
    ],
    ]

  • allanallan Posts: 65,254Questions: 1Answers: 10,816 Site admin

    Ah, you want to show the number of entries (count) in the column with that value? That is not a feature of ColumnControl at this time I'm afraid, but it is one I can add to the list.

    Allan

  • paulobocpauloboc Posts: 12Questions: 0Answers: 0

    Yes, that’s exactly it. It will be very useful — thank you, Allan!

  • MiwerMiwer Posts: 2Questions: 0Answers: 0

    Hi Allan,

    I just want to add to this feature request.
    In addition to the count, I would like the option for searchList to be updated, to only show items from the filtered dataset, when filtering other columns, not the entire dataset.

    Take your Basic searchList example:
    If you filter out Office to Tokyo only first...

    Then you still have the entire searchList entries for Position, not only those that exists for Tokyo office.

    There is really no need to show the entries, that are not in the filtered set, since they don't update the table when selected anyway.
    For reference, that is how Microsoft Excel works, and I find it very useful.

    There is of course a pitfall here, because you don't want to update the column you are currently selecting from, in case you want to select multiple items. Only OTHER searchList columns should be updated.

    Thank you for a great product. :smiley:

  • allanallan Posts: 65,254Questions: 1Answers: 10,816 Site admin

    Thanks for the feedback!

    SearchPanes has a cascade feature for exactly that sort of thing. Also, SearchPanes needs a bit of a rewrite. Those two points are not unrelated ;).

    The numbers shouldn't be an issue, but a cascade option for ColumnControl is likely some time away, whlie I'm working on other aspects of DataTables. I had added it to the features "todo" list though.

    Allan

  • MiwerMiwer Posts: 2Questions: 0Answers: 0

    Thank you for the hint about SearchPanes - I will definitely look into that. :smile:

    /Michael

Sign In or Register to comment.