jQWidgets Forums

jQuery UI Widgets Forums Grid Grid | Show/Hide Column Dynamically

This topic contains 2 replies, has 2 voices, and was last updated by  raj 9 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Grid | Show/Hide Column Dynamically #76770

    raj
    Participant

    Hi,

    I’ve a grid of 10 columns in which only 5 columns are important and the rest I made it as hidden in columns definition (hidden:true).

    Also, I’ve built one custom listbox that will be like a filter menu i.e. this will be visible when cog wheel dropdown icon is clicked. I’ll show the custom listbox in a pop-up with “Apply” button. This listbox contains the list of all hidden column names with checkboxes.

    So whenever the user wants to see any hidden columns, the respective column name checkbox is checked and click on “Apply” button. I’ll show the hidden column using following code along with the “getCheckedItems” list,

    $('#userSummary').jqxGrid('hidecolumn', 'lastModifiedDate');

    Let’s say, I’ve checked all 5 columns and clicked on “Apply” button. I can able to show all 5 hidden columns. Suppose If I uncheck all and clicked on “Apply“, I couldn’t able to restore the grid to the previous state i.e. grid with 5 important columns.

    Hope I explained clearly. Can someone suggest me a solution?

    Looking forward.

    Regrads,
    Raj

    Grid | Show/Hide Column Dynamically #76772

    Vladimir
    Participant

    Hello Raj,

    You can call ‘showcolumn‘ for each checked item, and ‘hidecolumn‘ for each unchecked, when you press apply.
    This way you will set the state for each column each time you hit apply.

    Best Regards,
    Vladimir

    jQWidgets Team
    http://www.jqwidgets.com

    Grid | Show/Hide Column Dynamically #76815

    raj
    Participant

    Hi Vladimir,

    I tried as you suggested and it is working fine :-). Thanks for your reply.

    Regards,
    Raj

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

You must be logged in to reply to this topic.