jQuery UI Widgets Forums Grid Ability to define a custom grouping mechanism

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

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

  • Popoff
    Participant

    Hello All,

    I am using a grid with the grouping feature, so that the user can drag and drop a column into the dedicated area above the grid to group by that column.

    In some columns of my grid, the contained value is actually a list of values (1 to N values), say, comma-separated.
    When the user groups the records by that column, my need is to build groups based on each value of that comma-separated list, and not based on the whole list (i.e. the whole cell value).
    As a consequence, each group created that way would contain the records for which the selected column contains the current grouping value, instead of equals the current grouping value.
    Obviously, if a record has N distinct values in that column, the user would find that record repeated in the N resulting groups.

    I did not find any native feature in the Grid widget that allows the developer to write its own grouping algorithm on a given column, perhaps I missed something.

    Is it possible to accomplish this, and what would be the best approach to implement it?

    Here below is a simplified illustration of my problem.

    The grid – initial view:

    BOOK_ID | TITLE | EDITOR | THEMES
    1       | tit1  | ed1    | a,b,c
    2       | tit2  | ed1    | c
    3       | tit3  | ed2    | b,d

    The grid – grouped-by-theme view:

    BOOK_ID | TITLE | EDITOR | THEMES
    a (1)
    1       | tit1  | ed1    | a,b,c
    b (2)
    1       | tit1  | ed1    | a,b,c
    3       | tit3  | ed2    | b,d
    c (2)
    1       | tit1  | ed1    | a,b,c
    2       | tit2  | ed1    | c
    d (1)
    3       | tit3  | ed2    | b,d

    Thank you for your help.


    Peter Stoev
    Keymaster

    Hi Popoff,

    The feature you’re looking for is not available in our Grid and unfortunately there’s no option to implement it, too.

    Best Regards,
    Peter Stoev

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


    Popoff
    Participant

    Noooooooooo, please don’t answer that!
    OK… is there any other widget I could use that would allow me to build such view, even if it does not have the aspect of a grid?
    And/or a workaround by re-arranging data before rendering them (of course I would like to avoid making duplicate rows for a given book title, like SQL does when merging information from 2 tables linked by a “1 to N” relashionship).

    Whatever the final rendering, I need to have this grouping logic.
    Feels like I will have to build my own widget to achieve this…!


    Peter Stoev
    Keymaster

    Hi Popoff,

    By using the dataAdapter’s beforeLoadComplete you can customize your data before loading it into a Grid or other data widget. To learn how to use it, look at: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdataadapter/jquery-data-adapter.htm

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.