jQWidgets Forums

jQuery UI Widgets Forums Grid Grid – Add Columns

This topic contains 4 replies, has 3 voices, and was last updated by  jahnvi25 12 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Grid – Add Columns #19074

    vmanne
    Participant

    Is there a way to add/remove columns dynamically? What I’m attempting to get is, to have a dropdownlist of “Views” which has a pre-defined set of columns that needs to be shown to the user.

    E.g., Default View, Admin View, HR View and Accounts View.

    When user lands on page, Default View gets loaded and, I’d like the grid to show columns Col A, Col B, Col C, Col D, Col E, Col F
    When user selects Admin View, I’d like the grid to show only Col A, Col B and Col C.
    When user selects HR View, I’d like the grid to show only Col A, Col D and Col F.
    ….

    etc

    Currently this is what I’m doing

    On Grid’s ready: function () {}, I’m hiding and showing columns. However, with this approach, I need to first get all columns and they appear to load and user sees all columns and then after a minute, grid refreshes and appropriate columns are shown.

    I’d like to know if there is a way to dynamically add columns to the columns collection, without the need to explicitly declare them in the grid definition.

    Thank you for your time on this.

    Grid – Add Columns #19091

    Peter Stoev
    Keymaster

    Hi vmanne,

    It is not necessary to hide the columns in the ready callback. If you know which column should be hidden, set its “hidden” property to true when you define it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid – Add Columns #19468

    jahnvi25
    Participant

    i have the same requirement.. with slight change..

    for default View : col1,col2 and col3 are visible..
    but then for Admin view : i need col4,col5,col6 (new set of columns) so i would like to remove col1,col2 and col3 and add col4,col5 and col6..

    is it possible to go that ?

    Grid – Add Columns #19490

    Peter Stoev
    Keymaster

    Hi jahnvi25,

    You can use the same approach with hiding and showing columns dynamically.

    Best Regards,
    Peter Stoev

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

    Grid – Add Columns #19565

    jahnvi25
    Participant

    thanks for reply.. i tried using same approach.. and its working fine.. but it seems slow..

    on a click on Button i am trying hide around 8 columns and showing another set of 8 columns..
    but these new set of columns dont have any data… ( i am using group renderer.. so i calculate when a particular group is open)

    is there anything i can do to improve performance.. or am i missing something ?

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

You must be logged in to reply to this topic.