Results 1 to 6 of 6

Thread: show/hide columns in grid with responsive plugin

  1. #1
    Sencha Premium Member matei's Avatar
    Join Date
    Jun 2008
    Location
    Cluj-Napoca
    Posts
    83
    Answers
    1

    Default Answered: show/hide columns in grid with responsive plugin

    Is there an easy way to show/hide columns inside an Ext.grid.Panel with responsiveConfig (Ext.plugin.Responsive)?

  2. Thanks all.
    column has setter for show/hide.
    but wandering if there is a better way to config without functions/events.
    I was using resize event on grid:

    Code:
    me.on({
        resize: (grid, width) => {
            grid.down("[dataIndex=total]").setVisible(width > 700);
            grid.down("[dataIndex=languages]").setVisible(width > 800);
        }
    })

  3. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Hi there! I'm sending your question to a team member and we will get you a response ASAP. Thanks!

  4. #3
    Sencha - Support Team
    Join Date
    Sep 2017
    Posts
    67

    Default

    We cannot hide/show columns in grid using responsive plugin as responsive config can only be used for configs that have setter and grid doesn't have column setter. To show/hide columns, we can use grid.reconfigure https://docs.sencha.com/extjs/6.6.0/...nt-reconfigure based on width/height of browser.


    A fiddle for your reference : https://fiddle.sencha.com/#view/editor&fiddle/2l6c

    Regards,
    Joe.

  5. #4
    Sencha Premium User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,231
    Answers
    26

    Default

    or something like this: https://fiddle.sencha.com/#fiddle/j2m&view/editor

    extjs is adaptive, so you need to react to box changes in the GUI, so you can add an event listener to the parent container and then react to it (like in above), then hide or reconfigure based on that.
    Cloud Application Architect

    Sencha Specialist / Sencha MVP / Sencha Technical Trainer
    ExtJs Developer + Contributor since 0.2.2 - Champion of the per developer license.

  6. #5
    Sencha Premium Member matei's Avatar
    Join Date
    Jun 2008
    Location
    Cluj-Napoca
    Posts
    83
    Answers
    1

    Default

    Thanks all.
    column has setter for show/hide.
    but wandering if there is a better way to config without functions/events.
    I was using resize event on grid:

    Code:
    me.on({
        resize: (grid, width) => {
            grid.down("[dataIndex=total]").setVisible(width > 700);
            grid.down("[dataIndex=languages]").setVisible(width > 800);
        }
    })

  7. #6
    Sencha Staff
    Join Date
    Sep 2017
    Posts
    126
    Answers
    1

    Default

    Hello,

    setVisible or hide method are only options to hide column, if you don't want to reconfigure grid


    Docs for hide - https://docs.sencha.com/extjs/6.6.0/...ml#method-hide


    Fiddle hiding columns - https://fiddle.sencha.com/#fiddle/1f51&view/editor

    Regards,
    Pavan.

    Sencha Support.

Similar Threads

  1. Grid show/hide columns
    By nkezhaya in forum Ext: Q&A
    Replies: 5
    Last Post: 5 Mar 2014, 3:12 AM
  2. show/hide columns in grid
    By Abhishek Srivastava in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 18 May 2012, 5:42 AM
  3. show hide columns in Grid
    By anshumap in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 6 Oct 2010, 9:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •