jQWidgets Forums

jQuery UI Widgets Forums Grid How to hide the column name used in grouping

This topic contains 7 replies, has 4 voices, and was last updated by  MaxWell 11 years ago.

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

  • ymam
    Member

    setting the following grid properties to:
    groupable: true,
    groups: [‘name’],
    showgroupsheader: false,
    I would like to hide the title ‘name’ from the displayed rows. and also I have a nested grouping on other column, is it possible to not display the redudant column name ‘name’ in each row displayed but only the value of the column.


    Peter Stoev
    Keymaster

    Hi ymam,

    You can add a ‘groupsrenderer’ function which will override the built-in groups rendering. The HTML returned by the function will be the HTML displayed in the Groups.

    The code snippet below shows how to display only the value’s name.

    $("#jqxgrid").jqxGrid(
    {
    width: 600,
    source: source,
    groupable: true,
    theme: theme,
    columns: [
    { text: 'Company Name', datafield: 'CompanyName', width: 250 },
    { text: 'City', datafield: 'City', width: 120 },
    { text: 'Country', datafield: 'Country' }
    ],
    groups: ['City'],
    groupsrenderer: function (defaultText, group, state, params) {
    return "<div style='margin: 5px;'>" + group + "</div>";
    }
    });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    ymam
    Member

    Thanks for your Peter, it works.

    I was looking for this too. Thanks!

    It is possible to hide columns that are grouped?
    Something like:


    $("#jqxgrid").jqxGrid(
    {
    width: 600,
    source: source,
    groupable: true,
    theme: theme,
    columns: [
    { text: 'Company Name', datafield: 'CompanyName', width: 250 },
    { text: 'City', datafield: 'City', width: 120 },
    { text: 'Country', datafield: 'Country' }
    ],
    groups: ['Country'],
    hidegroupedcolumns: true
    });


    Peter Stoev
    Keymaster

    Hi Alex,

    If you are looking for a functionality where a column is hidden when the user groups by the column and the column is shown again when the user removes it from the grouping panel, then the answer is no. Thank you very much about the suggestion! We’ll consider the feature’s implementation in a future version.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Hi Peter,

    Thanks for your answer. That’s exactly the functionality I’m looking for.
    Could you guide me to try implementing it myself? It’s very important to me.

    I was thinkin about bind a “groupschanged” event to identify the columns that are being grouped, and then hide them using the “hidecolumn” method, then try to increase the colspan of the previous column, something like that.

    Could you tell me if you think it’s possible? I’ll give it a go.

    Thank you!


    Peter Stoev
    Keymaster

    It it currently not possible to achieve that. We’ll need to implement it in the Grid as a built-in feature or extend the Grid’s API.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    MaxWell
    Participant

    Hi, Peter,

    It it currently not possible to achieve that. We’ll need to implement it in the Grid as a built-in feature or extend the Grid’s API.

    Is there this feature implemented? I don’t find it in docs.
    If no, can it be implemented in the near future?

    Thanks.

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

You must be logged in to reply to this topic.