jQuery UI Widgets Forums Grid Expanding group

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Expanding group #26371

    hf
    Participant

    Hi,

    I would like to expand a group based on a userid, but don’t know how determine which group number I’ve to get:

    function groupsrenderer(defaultText, group, state, params) {
    user = params.subItems[0].user;
    if (params.subItems[0].user == userid) {
    $("#jqxgrid").jqxGrid('expandgroup', ????);
    };
    };

    Regards

    Expanding group #26374

    Peter Stoev
    Keymaster

    Hi hf,

    It is not possible to expand a Group in a groups rendering function. The “expandgroup” method can expand only top-level groups and the
    expected parameter is the row’s index.

    Best Regards,
    Peter Stoev

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

    Expanding group #26376

    hf
    Participant

    Hi Peter,

    Okay, but in de grid’s ready function it will work. So I would like to save the correct groupnr in the groups rendering function and apply in the grid’s ready function.

    But I don’t know how to get that groupnr..

    function groupsrenderer(defaultText, group, state, params) {
    var user = params.subItems[0].user
    if (params.subItems[0].chef == 3) {
    groupnr = ???;
    };
    return "<div style='margin: 5px;'>" + x + "</div>";
    };
    ready: function () {
    $("#jqxgrid").jqxGrid('hidecolumn', 'whatever');
    addfilter();
    $("#jqxgrid").jqxGrid('expandgroup', groupnr);
    },
    Expanding group #26422

    Peter Stoev
    Keymaster

    Hi hf,

    You cannot expand a group when you render it in the “groupsrenderer”. You also cannot expand a group through the API unless it is a root group. In addition “groupsrenderer” is called when the group becomes visible and have to be rendered. If the group is not part of your view and is still not rendered your logic for saving a group will not work. You can call “expandgroup” and pass index of the group in the “ready” callback or in the “bindingcomplete” event handler.

    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.