ce icon indicating copy to clipboard operation
ce copied to clipboard

Hide Columns

Open VictorCandido opened this issue 6 years ago • 23 comments

Hello. Is there any way of hide a column? When I use $('column').hide(), I loose all my CSS configuration, so could be very nice to have an implementation of an event to hide a column by it's index.

VictorCandido avatar Dec 13 '19 14:12 VictorCandido

Hi,

You can set type of column to hidden ?

jexcel(document.getElementById('spreadsheet'), {
    data:data,
    columns: [
        {
            type: 'text',
            title:'Car',
            width:90
        },
        {
            type: 'dropdown',
            title:'Make',
            width:120,
            source:[
                "Alfa Romeo",
                "Audi",
                "Bmw",
                "Chevrolet",
                "Chrystler",
                "Dodge",
                "Ferrari",
              ]
        },
        {
            type: 'hidden',
        },
     ]
});

Or defined style with Jquery Selector $( 'table.jexcel tr td[data-x="0"]').css( "display", "none" );

0 is an index of column

GBonnaire avatar Dec 15 '19 15:12 GBonnaire

The problem in setting the column hidden is that I need the event to be dynamic. I need to set hidden in some cases and other cases be visible. Is there a way to do that?

I'm already doind with jQuery "$( 'table.jexcel tr td[data-x="0"]').css( "display", "none" );", but the problem is that I have a lot custom css on the cells, rows and columns... When I hide the column with this function of jQuery, I destroy all my CSS, so I need to recreate almoast everything.

VictorCandido avatar Dec 16 '19 12:12 VictorCandido

In JExcel, when you set to hidden a column, you set display:none on this column. you give same problem.

can you test with visibilty:hidden and/or width: 0px ?

GBonnaire avatar Dec 17 '19 08:12 GBonnaire

I have created some new methods to dynamically show and hide columns.

table.showColumn(colNumber); // the first column is column 0 table.hideColumn(colNumber); // the first column is column 0

pphod avatar Dec 20 '19 13:12 pphod

Thank you so much!! That's what I needed

VictorCandido avatar Dec 23 '19 12:12 VictorCandido

@paulhodel @Guillaume-Bo can you guys please comment on issue: https://github.com/paulhodel/jexcel/issues/1162

debamishra14 avatar Oct 01 '20 05:10 debamishra14

@pphod Is there any method could hide rows just like hideColumn() ?

Louise-Huang avatar Jul 05 '21 06:07 Louise-Huang

I tried to use table.hideRow(rowNum). It seems that there is this method, but no matter what the rowNum is, only the first row will be hidden.

Louise-Huang avatar Jul 05 '21 07:07 Louise-Huang

Hi,

i tried, and hideRow hide the complet row not only first column. 0 = first row

Can you reproduct error on jsfiddle ?

GBonnaire avatar Jul 05 '21 08:07 GBonnaire

@GBonnaire

Hi, here is my codepen. https://codepen.io/LouiseHuang/pen/oNWbjrX

Louise-Huang avatar Jul 05 '21 09:07 Louise-Huang

Hi, ty

Ok problem is on version Pro. For support for version pro is here : https://github.com/jspreadsheet/pro/issues

I inform team of development of this bug thanks

GBonnaire avatar Jul 05 '21 09:07 GBonnaire

Hi,

Oh, I'm so sorry that I didn't find this page is support for version CE. Anyway, thank you so much.

Louise-Huang avatar Jul 05 '21 09:07 Louise-Huang

Don't worries, here we help for version Pro too, but i'm not dev of JSS Pro, only Dev plugins of JSS Pro and i help here when i can 😊 And for bug like this, on page support, Team dev see easier the problems 😊

Have good day

GBonnaire avatar Jul 05 '21 09:07 GBonnaire

Hi, I take the liberty to ask, when will this method be fixed in version pro? Because I'm a bit urgent. Thank you.

Louise-Huang avatar Jul 06 '21 07:07 Louise-Huang

That will be fixed today.

hodeware avatar Jul 06 '21 08:07 hodeware

@hodeware Awesome! Thank you so much! 😄

Louise-Huang avatar Jul 06 '21 08:07 Louise-Huang

It has been fixed. v7.9.20+

hodeware avatar Jul 06 '21 22:07 hodeware

@hodeware First of all, thank you for quickly solving my problem, hideRow can be used normally, but I found that showRow seems to be unavailable. Could you please fix it again? Thank you so much.

Louise-Huang avatar Jul 07 '21 06:07 Louise-Huang

Hi Louise, Both methods are available. hideRow, showRow

Are you using Pro?

hodeware avatar Jul 07 '21 22:07 hodeware

Hi Paul, Yes, I do use pro v7. And I really can not use showRow 😢

https://codepen.io/LouiseHuang/pen/oNWbjrX

Louise-Huang avatar Jul 08 '21 02:07 Louise-Huang