jQuery UI Widgets Forums Grid Show/hide selected rows

This topic contains 3 replies, has 3 voices, and was last updated by  JessGO 9 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Show/hide selected rows #28862

    stephenmc
    Member

    Hi

    Im relatively new to jqxWidget, so this may be an easy question for most of you!

    I have a toggle button at the bottom of jqxGrid (custom jQuery) which, when selected, should toggle between All, and Selected rows. Im probably using the ‘hiderowdetails’ method incorrectly, but I assumed I can just do something like

    				for (var ri = 0; ri < grid.jqxGrid('getdatainformation').rowscount; ri++){
    if(selectedIndexes.indexOf(ri) < 0){
    grid.jqxGrid('hiderowdetails', ri);
    //console.log("Row (apparently) hidden");
    }
    }

    Any help greatly appreciated.

    Show/hide selected rows #28870

    Peter Stoev
    Keymaster

    Hi stephenmc,

    The “showrowdetails” and “hiderowdetails” are methods for showing/hiding row details, but not Rows in the Grid. What is the idea of your code? Hiding the details of the unselected rows?

    Best Regards,
    Peter Stoev

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

    Show/hide selected rows #28923

    stephenmc
    Member

    Hey Peter

    Thanks for responding.

    Yeah I figured that was the purpose of those two methods. The idea is to toggle between checked rows and all rows (retaining rows that are selected). Initially I was using two view models, and just rendering the grid again each time, but there is a performance degradation with this.

    I then implemented a jQuery solution using hide(), but that causes issues with the displayed rows being truncated.

    Any ideas?

    Show/hide selected rows #60770

    JessGO
    Participant

    Hi everybody
    I did this solution:
    $(“#hide”).click(function(){
    var rows = $(“#grid”).jqxGrid(‘getdatainformation’);
    for (var ri = 0; ri <rows.rowscount; ri++){
    $(“#grid”).jqxGrid(‘hiderowdetails’,ri);
    }
    });

    Best Regards 🙂

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

You must be logged in to reply to this topic.