Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Dynamically hide a column and its footer.
posted

Hi I am using webhierachicalDataGrid and have a band with the product and quantity for each month of the fiscal year. The users can turn on and off to see all 12 months or just certain months, in which case I hide the months that they don't want to see. But when I hide the column, the footer is still showing the month that I hide.  Please advise how can achieve it.

Thanks,

  • 11095
    Offline posted

    Hello Antonio,

    The footer can be hidden by setting css display value of the elemnt representing it to none.

    var gridView = $find("grid-id").get_gridView();
    var columns = gridView.get_columns();
    var firstNameColumn = columns.get_columnFromKey("FirstName");
    var footer = firstNameColumn.get_footer();
    firstNameColumn.set_hidden(true)
    var footerElement = footer.get_element();
    footerElement.style.display = "none";

    The same can be used to hide a footer in the childs rows. The child grid can be accessed from the row island of the row containing it.

    var rows = gridView.get_rows();
    var row = rows.get_row(0);
    var childGrid = row.get_rowIslands()[0];

    Let me know if I may be of further assitance.